[Feature] Multi dub w/ season constraints #603

Merged
Denoder merged 7 commits from Feature]-Multi-Dub-w/-season-constraints into master 2024-03-21 17:53:55 +00:00
Denoder commented 2024-03-21 04:35:27 +00:00 (Migrated from github.com)

I created this because there are times where i want to get multiple dubs within a series but i cant do that with -s and --srz uses indexes rather than episode numbers for ordering. With this change the following output will be generated when using both -s and --srz:

[E1|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Failed... Hero [Japanese, English, Portuguese, Spanish]
[E2|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Black Spider of Disaster [Japanese, English, Portuguese, Spanish]
[E3|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Human Shock [Japanese, English, Portuguese, Spanish]
[E4|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Too Late [Japanese, English, Portuguese, Spanish]
[E5|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - The Greedy Wagon's Journey [Japanese, English, Portuguese, Spanish]
[E6|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - The Melancholy of Handsome Middle-Aged Men [Japanese, English, Portuguese, Spanish]
[E7|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Wondrous Medicine Production [Japanese, English, Portuguese, Spanish]
[E8|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Demiplane Ranking [Japanese, English, Portuguese, Spanish]
[E9|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Eat or Be Eaten [Japanese, Portuguese, Spanish, English]
[E10|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Hidden Ogre Village [Japanese, Portuguese, Spanish, English]
[E11|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Goodbye [Japanese, Portuguese, Spanish, English]
[E12|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Guided by the Moon... [Japanese, Portuguese, Spanish, English]
[E1|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - What? Moon over the Ruined Castle? [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish]
[E2|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Heroes Are a Couple of Beauties [☆ Japanese, ☆ English, ☆ Spanish, ☆ Portuguese]
[E3|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Stellar Wars [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish]
[E4|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Why Am I a Teacher?! [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish]
[E5|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Lesson Will Now Begin [☆ Japanese, ☆ Portuguese, ☆ Spanish, ☆ English]
[E6|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Becoming a Three-Star Chef [☆ Japanese, ☆ Spanish, ☆ Portuguese, ☆ English]
[E7|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - New Member Audition [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish]
[E8|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Notorious Beautiful Sisters [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish]
[E9|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Perverted Dragon [☆ Japanese, ☆ English]
[E10|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Watch As I Improve the World [☆ Japanese]
[E11|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Summer of Growth and New Skills [☆ Japanese]

With this, it sorts by season_id and episode (using season numbers is convoluted with cr's api)

if you exclude -s it falls back to the original format of using indexes (so it'll be number 1-23...etc) so overall this will retain the same functionality, but with the added effect that using -s will constrain it to the season and allow -e to use the episode number of that season.

I created this because there are times where i want to get multiple dubs within a series but i cant do that with `-s` and `--srz` uses indexes rather than episode numbers for ordering. With this change the following output will be generated when using both `-s` and `--srz`: ```txt [E1|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Failed... Hero [Japanese, English, Portuguese, Spanish] [E2|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Black Spider of Disaster [Japanese, English, Portuguese, Spanish] [E3|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Human Shock [Japanese, English, Portuguese, Spanish] [E4|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Too Late [Japanese, English, Portuguese, Spanish] [E5|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - The Greedy Wagon's Journey [Japanese, English, Portuguese, Spanish] [E6|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - The Melancholy of Handsome Middle-Aged Men [Japanese, English, Portuguese, Spanish] [E7|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Wondrous Medicine Production [Japanese, English, Portuguese, Spanish] [E8|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Demiplane Ranking [Japanese, English, Portuguese, Spanish] [E9|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Eat or Be Eaten [Japanese, Portuguese, Spanish, English] [E10|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Hidden Ogre Village [Japanese, Portuguese, Spanish, English] [E11|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Goodbye [Japanese, Portuguese, Spanish, English] [E12|SGY2PCV21D] TSUKIMICHI -Moonlit Fantasy- - Season 1 - Guided by the Moon... [Japanese, Portuguese, Spanish, English] [E1|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - What? Moon over the Ruined Castle? [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish] [E2|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Heroes Are a Couple of Beauties [☆ Japanese, ☆ English, ☆ Spanish, ☆ Portuguese] [E3|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Stellar Wars [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish] [E4|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Why Am I a Teacher?! [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish] [E5|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Lesson Will Now Begin [☆ Japanese, ☆ Portuguese, ☆ Spanish, ☆ English] [E6|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Becoming a Three-Star Chef [☆ Japanese, ☆ Spanish, ☆ Portuguese, ☆ English] [E7|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - New Member Audition [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish] [E8|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Notorious Beautiful Sisters [☆ Japanese, ☆ English, ☆ Portuguese, ☆ Spanish] [E9|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - The Perverted Dragon [☆ Japanese, ☆ English] [E10|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Watch As I Improve the World [☆ Japanese] [E11|SG69PC2JJ4] TSUKIMICHI -Moonlit Fantasy- Season 2 - Season 2 - Summer of Growth and New Skills [☆ Japanese] ``` With this, it sorts by season_id and episode (using season numbers is convoluted with cr's api) if you exclude `-s` it falls back to the original format of using indexes (so it'll be number 1-23...etc) so overall this will retain the same functionality, but with the added effect that using `-s` will constrain it to the season and allow `-e` to use the episode number of that season.
AnimeDL commented 2024-03-21 04:58:29 +00:00 (Migrated from github.com)

While the code looks good and appears to work, I do have a couple questions.

  1. When adding a season constraint by ID, wouldn't it be better not to show the other seasons in the first place? It may be confusing to see everything that isn't in the constraint. If that is done, then the Season ID next to the episode also becomes unnecessary. (It would also allow for --all for multi-dub on a specific season in a --srz)
  2. When you say ordering, do you mean the order of the list specifically, or the resulting episode number ordering (IE, filename)?
While the code looks good and appears to work, I do have a couple questions. 1. When adding a season constraint by ID, wouldn't it be better not to show the other seasons in the first place? It may be confusing to see everything that isn't in the constraint. If that is done, then the Season ID next to the episode also becomes unnecessary. (It would also allow for `--all` for multi-dub on a specific season in a `--srz`) 2. When you say ordering, do you mean the order of the list specifically, or the resulting episode number ordering (IE, filename)?
Denoder commented 2024-03-21 05:09:50 +00:00 (Migrated from github.com)
  1. Yes I just didn't change the logs to reflect that. I'll change it.
  2. Episode numbering, like when im searching episode 11 in a series (while i was using -s) I was expecting to get episode 11 of season 2 but it gave me episode 11 of season 1 because it ignored the -s param.
1. Yes I just didn't change the logs to reflect that. I'll change it. 2. Episode numbering, like when im searching episode 11 in a series (while i was using `-s`) I was expecting to get episode 11 of season 2 but it gave me episode 11 of season 1 because it ignored the `-s` param.
Denoder commented 2024-03-21 06:11:44 +00:00 (Migrated from github.com)

@AnimeDL I've made the changes

@AnimeDL I've made the changes
AnimeDL commented 2024-03-21 16:01:25 +00:00 (Migrated from github.com)

Alright, did some more testing and this does seem to break the GUI in it's current state due to ./gui/server/services/crunchyroll.ts L22, since data isn't passed data.s doesn't exist and throws an exception. Once that's fixed, this is probably good to go

Alright, did some more testing and this does seem to break the GUI in it's current state due to ./gui/server/services/crunchyroll.ts L22, since data isn't passed `data.s` doesn't exist and throws an exception. Once that's fixed, this is probably good to go
Denoder commented 2024-03-21 16:54:04 +00:00 (Migrated from github.com)

Alright, I changed it.

On a side node if you're still looking to have the specials be located at the end of the episode listing (in the TODO comment) doing something like:

const specials = Object.entries(episodes).filter(a => a[0].startsWith('S')),
      normal = Object.entries(episodes).filter(a => a[0].startsWith('E')),
      sortedEpisodes = Object.fromEntries([...normal, ...specials]);

After they get prepended with E and S would work, then have then have the console.info for loop and the return object use sortedEpisodes

Alright, I changed it. On a side node if you're still looking to have the specials be located at the end of the episode listing (in the TODO comment) doing something like: ```ts const specials = Object.entries(episodes).filter(a => a[0].startsWith('S')), normal = Object.entries(episodes).filter(a => a[0].startsWith('E')), sortedEpisodes = Object.fromEntries([...normal, ...specials]); ``` After they get prepended with `E` and `S` would work, then have then have the console.info for loop and the return object use `sortedEpisodes`
AnimeDL (Migrated from github.com) reviewed 2024-03-21 17:11:48 +00:00
AnimeDL (Migrated from github.com) commented 2024-03-21 17:11:47 +00:00

Is there a reason to use data: CrunchyMultiDownload | undefined = undefined here instead of data?: CrunchyMultiDownload?

Is there a reason to use `data: CrunchyMultiDownload | undefined = undefined` here instead of `data?: CrunchyMultiDownload`?
Denoder (Migrated from github.com) reviewed 2024-03-21 17:39:24 +00:00
Denoder (Migrated from github.com) commented 2024-03-21 17:39:24 +00:00

changed, my vscode auto-suggests things so i don't usually argue with what it suggests.

changed, my vscode auto-suggests things so i don't usually argue with what it suggests.
AnimeDL commented 2024-03-21 17:53:46 +00:00 (Migrated from github.com)

LGTM, Merging

LGTM, Merging
Sign in to join this conversation.
No description provided.