From 5d860ec9675a832dca5e8fd855bca0c9debfb5ef Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 23 Aug 2024 13:51:32 -0700 Subject: refactor(Tools): SequelCatcher as modules --- src/lib/Tools/SequelCatcher.svelte | 124 -------------------------------- src/lib/Tools/SequelCatcher/List.svelte | 50 +++++++++++++ src/lib/Tools/SequelCatcher/Tool.svelte | 80 +++++++++++++++++++++ 3 files changed, 130 insertions(+), 124 deletions(-) delete mode 100644 src/lib/Tools/SequelCatcher.svelte create mode 100644 src/lib/Tools/SequelCatcher/List.svelte create mode 100644 src/lib/Tools/SequelCatcher/Tool.svelte (limited to 'src/lib/Tools') diff --git a/src/lib/Tools/SequelCatcher.svelte b/src/lib/Tools/SequelCatcher.svelte deleted file mode 100644 index 5d7cf81a..00000000 --- a/src/lib/Tools/SequelCatcher.svelte +++ /dev/null @@ -1,124 +0,0 @@ - - -{#if user === undefined || $identity.id === -2} - -{:else} -
- {#await mediaList} - - - - {:then mediaListUnchecked} - {#if mediaListUnchecked} - {@const mediaList = mediaListUnchecked.filter( - (media) => media.mediaListEntry?.status === 'COMPLETED' - )} - -
    - {#each filterRelations(mediaList) as { media, unwatchedRelations }} - - - - - ({media.startDate.year}) - - -
      - {#each unwatchedRelations as relation} -
    1. - - - - - ({relation.node.startDate.year}) - -
    2. - {/each} -
    - {/each} -
- {:else} - - - - {/if} - {:catch} - Error fetching media. - {/await} - -

- -

- Thanks to and for the idea! -
-
-{/if} - - diff --git a/src/lib/Tools/SequelCatcher/List.svelte b/src/lib/Tools/SequelCatcher/List.svelte new file mode 100644 index 00000000..685cae72 --- /dev/null +++ b/src/lib/Tools/SequelCatcher/List.svelte @@ -0,0 +1,50 @@ + + +
    + {#each filterRelations(mediaList) as { media, unwatchedRelations }} + + + + + ({media.startDate.year}) + + +
      + {#each unwatchedRelations as relation} +
    1. + + + + + ({relation.node.startDate.year}) + +
    2. + {/each} +
    + {/each} +
+ + diff --git a/src/lib/Tools/SequelCatcher/Tool.svelte b/src/lib/Tools/SequelCatcher/Tool.svelte new file mode 100644 index 00000000..06d635b3 --- /dev/null +++ b/src/lib/Tools/SequelCatcher/Tool.svelte @@ -0,0 +1,80 @@ + + +{#if user === undefined || $identity.id === -2} + +{:else} +
+ {#await mediaList} + + + + {:then mediaListUnchecked} + {#if mediaListUnchecked} + + {:else} + + + + {/if} + {:catch} + Error fetching media. + {/await} + +

+ +

+ Thanks to and for the idea! +
+
+{/if} -- cgit v1.2.3