aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-01 16:49:04 -0800
committerFuwn <[email protected]>2024-01-01 16:49:04 -0800
commit60253beb9bad111c02ffa94cb64427cbe9c3ff17 (patch)
treef7cce19ecf8635062a1c4b30504e608321a632b9 /src/lib
parentfix(schedule): null episodes (diff)
downloaddue.moe-60253beb9bad111c02ffa94cb64427cbe9c3ff17.tar.xz
due.moe-60253beb9bad111c02ffa94cb64427cbe9c3ff17.zip
feat(schedule): crunchyroll schedule
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Tools/Schedule/Crunchyroll.svelte54
-rw-r--r--src/lib/crunchyroll.json61
2 files changed, 115 insertions, 0 deletions
diff --git a/src/lib/Tools/Schedule/Crunchyroll.svelte b/src/lib/Tools/Schedule/Crunchyroll.svelte
new file mode 100644
index 00000000..8162beed
--- /dev/null
+++ b/src/lib/Tools/Schedule/Crunchyroll.svelte
@@ -0,0 +1,54 @@
+<script lang="ts">
+ import crunchyroll from '$lib/crunchyroll.json';
+ import { onMount } from 'svelte';
+
+ const days = crunchyroll
+ .filter((media) => media.day !== 'soon' && media.day !== 'continuing')
+ .reduce((acc, media) => {
+ const date = new Date(media.year, media.month - 1, media.day).toLocaleDateString();
+ if (!acc[date]) {
+ acc[date] = [];
+ }
+ acc[date].push(media);
+ return acc;
+ }, {});
+ const continuing = crunchyroll.filter((media) => media.day === 'continuing');
+ const soon = crunchyroll.filter((media) => media.day === 'soon');
+
+ const ordinalSuffix = (i: number) => {
+ const j = i % 10;
+ const k = i % 100;
+
+ if (j === 1 && k !== 11) return i + 'st';
+ if (j === 2 && k !== 12) return i + 'nd';
+ if (j === 3 && k !== 13) return i + 'rd';
+
+ return i + 'th';
+ };
+</script>
+
+{#each Object.values(days) as day}
+ {@const date = new Date(day[0].year, day[0].month - 1, day[0].day)}
+
+ {date.toLocaleString('default', { month: 'long' })}
+ {ordinalSuffix(day[0].day)}, {day[0].year}
+ <ul>
+ {#each day as media}
+ <li>{media.title}</li>
+ {/each}
+ </ul>
+{/each}
+
+Coming soon
+<ul>
+ {#each soon as media}
+ <li>{media.title}</li>
+ {/each}
+</ul>
+
+Continuing from previous season
+<ul>
+ {#each continuing as media}
+ <li>{media.title}</li>
+ {/each}
+</ul>
diff --git a/src/lib/crunchyroll.json b/src/lib/crunchyroll.json
new file mode 100644
index 00000000..85abc682
--- /dev/null
+++ b/src/lib/crunchyroll.json
@@ -0,0 +1,61 @@
+[
+ { "year": 2023, "month": 12, "day": 29, "title": "Burn the Witch #0.8" },
+ { "year": 2024, "month": 1, "day": 1, "title": "Fluffy Paradise" },
+ { "year": 2024, "month": 1, "day": 3, "title": "Classroom of the Elite Season 3" },
+ { "year": 2024, "month": 1, "day": 3, "title": "Bottom-Tier Character Tomozaki Season 2" },
+ { "year": 2024, "month": 1, "day": 5, "title": "The Demon Prince of Momochi House" },
+ { "year": 2024, "month": 1, "day": 5, "title": "Sasaki and Peeps" },
+ { "year": 2024, "month": 1, "day": 5, "title": "The Unwanted Undead Adventurer" },
+ { "year": 2024, "month": 1, "day": 5, "title": "The Wrong Way to Use Healing Magic" },
+ { "year": 2024, "month": 1, "day": 6, "title": "One Piece: Egghead Island Arc" },
+ { "year": 2024, "month": 1, "day": 6, "title": "Solo Leveling" },
+ { "year": 2024, "month": 1, "day": 6, "title": "A Sign of Affection" },
+ { "year": 2024, "month": 1, "day": 6, "title": "Tales of Weddings Rings" },
+ {
+ "year": 2024,
+ "month": 1,
+ "day": 7,
+ "title": "7th Time Loop: The Villainess Enjoys a Carefree Life Married to Her Worst Enemy!"
+ },
+ { "year": 2024, "month": 1, "day": 8, "title": "Tsukimichi -Moonlit Fantasy- Season 2" },
+ { "year": 2024, "month": 1, "day": 8, "title": "The Foolish Angel Dances With the Devil" },
+ { "year": 2024, "month": 1, "day": 8, "title": "Hokkaido Gals Are Super Adorable!" },
+ { "year": 2024, "month": 1, "day": 8, "title": "High Card Season 2" },
+ {
+ "year": 2024,
+ "month": 1,
+ "day": 9,
+ "title": "Villainess Level 99: I May Be the Hidden Boss but I'm Not the Demon Lord"
+ },
+ { "year": 2024, "month": 1, "day": 10, "title": "Metallic Rouge" },
+ { "year": 2024, "month": 1, "day": 10, "title": "Sengoku Youko" },
+ { "year": 2024, "month": 1, "day": 11, "title": "Delusional Monthly Magazine" },
+ { "year": 2024, "month": 1, "day": 13, "title": "Bucchigiri" },
+ { "year": 2024, "month": 1, "day": 14, "title": "Meji Gekken: 1874" },
+ { "year": 2024, "month": 1, "day": 14, "title": "The Fire Hunter Season 2" },
+ {
+ "year": 2024,
+ "month": 1,
+ "day": "soon",
+ "title": "Doctor Elise: The Royal Lady With the Lamp"
+ },
+ { "year": 2024, "month": 1, "day": "soon", "title": "Mashle: Magic and Muscles" },
+ { "year": 2024, "month": 1, "day": "soon", "title": "The Witch and the Beast" },
+ { "year": 2023, "month": 9, "day": "continuing", "title": "Frieren: Beyond Journey's End" },
+ { "year": 2023, "month": 9, "day": "continuing", "title": "The Apothecary Diaries" },
+ {
+ "year": 2023,
+ "month": 9,
+ "day": "continuing",
+ "title": "Firefighter Daigo: Rescuer in Orange"
+ },
+ { "year": 2023, "month": 9, "day": "continuing", "title": "Case Closed (Detective Conan)" },
+ { "year": 2023, "month": 9, "day": "continuing", "title": "Soaring Sky! Precure" },
+ { "year": 2023, "month": 9, "day": "continuing", "title": "Shangri-La Frontier" },
+ {
+ "year": 2023,
+ "month": 9,
+ "day": "continuing",
+ "title": "Captain Tsubasa Season 2: Junior Youth Arc"
+ }
+]