Komet / MediaElch

Media Manager for Kodi
https://mediaelch.github.io/mediaelch-doc/about.html
GNU Lesser General Public License v3.0
832 stars 93 forks source link

[TMDb] Use absolute numbering / episode groups #492

Open bugwelle opened 6 years ago

bugwelle commented 6 years ago

Asked on forum.kodi.tv

Many people don't structure animes into seasons. If you take for example "One Piece", TheTvDb lists 19 seasons. It should also be possible to have "one season" that contains all episodes because a lot of websites and users organize animes like that.

TheTvDb's API v2 has a field "absoluteNumber" (see https://api.thetvdb.com/swagger#!/Series/get_series_id_episodes). We could take that number to organize animes.

Maybe make that an option or introduce another "anime" section. I'm thinking about adding "Absolute Order" to the Drop Down List that already contains "DVD Order" and "Aired Order".

bugwelle commented 3 years ago

TheTvDb will be removed. So this issue can (sadly) be closed.

ticao2 commented 3 years ago

It seems that TMDb has this ability to sort, or have registered, by absolute number. https://developers.themoviedb.org/3/tv-episode-groups/get-tv-episode-group-details https://developers.themoviedb.org/3/tv/get-tv-episode-groups I don't know if users are using the feature. But we can expect some migration of users from TvDB to TMDb. And if anime fans prefer this method, they will probably start entering this data. :-)

bugwelle commented 3 years ago

You are right! Thanks!

Tested it for Scrubs and The Simpsons but they don't have groups. Futurama on the other hand:

{
    "results": [
        {
            "description": "",
            "episode_count": 129,
            "group_count": 9,
            "id": "5ad2557a0e0a266c25015a52",
            "name": "DVD Order",
            "network": null,
            "type": 3
        },
        {
            "description": "",
            "episode_count": 128,
            "group_count": 10,
            "id": "5ad25f9b0e0a266c3101674b",
            "name": "Digital Order",
            "network": null,
            "type": 4
        },
        {
            "description": "",
            "episode_count": 130,
            "group_count": 8,
            "id": "5ad24bf4c3a3683eed0145a8",
            "name": "Production Order",
            "network": null,
            "type": 6
        }
    ],
    "id": 615
}

I'M hijacking this issue for TMDb. :-)

AlphonseZetta10 commented 1 year ago

can't wait to have this feature because renaming hundreds of episodes is an impossible mission for me

Metal-Snake commented 1 year ago

I would love to get this higher up. I have some shows ripped from DVD which have different ordering than TMDB uses by default. So all scraped information is wrong.

mihawk90 commented 11 months ago

If we're talking about Anime then a lot more needs to be done then just scraping. Anime fansubs have over time gotten a fairly solidified naming scheme, just taking one example that is completely tripping up ME.

This is the original release name for these:

[tarulia@fedora The Twelve Kingdoms (1440x1080 h264 AC3 AAC)]$ ls
'[joseole99] The Twelve Kingdoms - 01 (1440x1080 h264 AC3 AAC) [5ED2AC93].mkv'
'[joseole99] The Twelve Kingdoms - 02 (1440x1080 h264 AC3 AAC) [64E90839].mkv'
'[joseole99] The Twelve Kingdoms - 03v2 (1440x1080 h264 AC3 AAC) [0A79B435].mkv'
'[joseole99] The Twelve Kingdoms - 04 (1440x1080 h264 AC3 AAC) [3150860F].mkv'
'[joseole99] The Twelve Kingdoms - 05 (1440x1080 h264 AC3 AAC) [37D04ADF].mkv'
'[joseole99] The Twelve Kingdoms - 06 (1440x1080 h264 AC3 AAC) [E09ABD30].mkv'
'[joseole99] The Twelve Kingdoms - 07 (1440x1080 h264 AC3 AAC) [CE516B8D].mkv'
'[joseole99] The Twelve Kingdoms - 08 (1440x1080 h264 AC3 AAC) [A36895D7].mkv'
'[joseole99] The Twelve Kingdoms - 09 (1440x1080 h264 AC3 AAC) [5819361A].mkv'
'[joseole99] The Twelve Kingdoms - 10 (1440x1080 h264 AC3 AAC) [0B3A5B2F].mkv'
'[joseole99] The Twelve Kingdoms - 11 (1440x1080 h264 AC3 AAC) [28BDFEB9].mkv'
'[joseole99] The Twelve Kingdoms - 12 (1440x1080 h264 AC3 AAC) [F439FA36].mkv'
'[joseole99] The Twelve Kingdoms - 13 (1440x1080 h264 AC3 AAC) [FE981CBD].mkv'
'[joseole99] The Twelve Kingdoms - 14 (1440x1080 h264 AC3 AAC) [D22EAB33].mkv'
'[joseole99] The Twelve Kingdoms - 15 (1440x1080 h264 AC3 AAC) [2515D480].mkv'
'[joseole99] The Twelve Kingdoms - 16 (1440x1080 h264 AC3 AAC) [1D8320F9].mkv'
'[joseole99] The Twelve Kingdoms - 17 (1440x1080 h264 AC3 AAC) [33963481].mkv'
'[joseole99] The Twelve Kingdoms - 18 (1440x1080 h264 AC3 AAC) [853782EB].mkv'
'[joseole99] The Twelve Kingdoms - 19 (1440x1080 h264 AC3 AAC) [B242C168].mkv'
'[joseole99] The Twelve Kingdoms - 20 (1440x1080 h264 AC3 AAC) [B8C8F2D7].mkv'
'[joseole99] The Twelve Kingdoms - 21 (1440x1080 h264 AC3 AAC) [7CCF37D6].mkv'
'[joseole99] The Twelve Kingdoms - 22v3 (1440x1080 h264 AC3 AAC) [C0616383].mkv'
'[joseole99] The Twelve Kingdoms - 23v3 (1440x1080 h264 AC3 AAC) [6F888813].mkv'
'[joseole99] The Twelve Kingdoms - 24v3 (1440x1080 h264 AC3 AAC) [BAAEA5BA].mkv'
'[joseole99] The Twelve Kingdoms - 25 (1440x1080 h264 AC3 AAC) [199B5DA2].mkv'
'[joseole99] The Twelve Kingdoms - 26 (1440x1080 h264 AC3 AAC) [AB469D66].mkv'
'[joseole99] The Twelve Kingdoms - 27 (1440x1080 h264 AC3 AAC) [B7F94E69].mkv'
'[joseole99] The Twelve Kingdoms - 28 (1440x1080 h264 AC3 AAC) [6CCD9F5A].mkv'
'[joseole99] The Twelve Kingdoms - 29 (1440x1080 h264 AC3 AAC) [112EB076].mkv'
'[joseole99] The Twelve Kingdoms - 30 (1440x1080 h264 AC3 AAC) [6B2916E9].mkv'
'[joseole99] The Twelve Kingdoms - 31 (1440x1080 h264 AC3 AAC) [5C5BCA95].mkv'
'[joseole99] The Twelve Kingdoms - 32 (1440x1080 h264 AC3 AAC) [A11D049A].mkv'
'[joseole99] The Twelve Kingdoms - 33 (1440x1080 h264 AC3 AAC) [2F77EA71].mkv'
'[joseole99] The Twelve Kingdoms - 34 (1440x1080 h264 AC3 AAC) [53A5A904].mkv'
'[joseole99] The Twelve Kingdoms - 35 (1440x1080 h264 AC3 AAC) [0A723298].mkv'
'[joseole99] The Twelve Kingdoms - 36 (1440x1080 h264 AC3 AAC) [2E22B18F].mkv'
'[joseole99] The Twelve Kingdoms - 37 (1440x1080 h264 AC3 AAC) [6A797A74].mkv'
'[joseole99] The Twelve Kingdoms - 38 (1440x1080 h264 AC3 AAC) [3FFBE867].mkv'
'[joseole99] The Twelve Kingdoms - 39v2 (1440x1080 h264 AC3 AAC) [30129FDC].mkv'
'[joseole99] The Twelve Kingdoms - 40 (1440x1080 h264 AC3 AAC) [A1F6C7DA].mkv'
'[joseole99] The Twelve Kingdoms - 41 (1440x1080 h264 AC3 AAC) [69DD4545].mkv'
'[joseole99] The Twelve Kingdoms - 42 (1440x1080 h264 AC3 AAC) [4CAE8472].mkv'
'[joseole99] The Twelve Kingdoms - 43 (1440x1080 h264 AC3 AAC) [371AFA68].mkv'
'[joseole99] The Twelve Kingdoms - 44 (1440x1080 h264 AC3 AAC) [FE044C25].mkv'
'[joseole99] The Twelve Kingdoms - 45 (1440x1080 h264 AC3 AAC) [5C0E0BD9].mkv'
 metadata

First of all, it doesn't recognise the name from the filenames, it only works off of folder names apparently, but that's not that big of a deal when there's a search field. Secondly when I threw this into Me the first time, it recognised everything as "Season 1440" and "Episode 1080". Obviously this is because of the resolution in the filename, and I get that this is normally used to parse the SxE scheme. However there would need to be some logic handling that should recognise that multiple files shouldn't be the same episode. Additionally it would be ideal if users could select regexes to disable for cornercases that can't be easily handled. Either way I went on to remove the resolution from the file name (yay shell scripts), but now it's apparently taking the [CRC32] as season and episode:

image

And I'll be honest I'm a little confused what exactly it's parsing here... For Season 00 I can see it, the CRC32 is 0Asomething For Season 01 and 02 same scheme For Season 04 it's apparently taking the 41 apart and ignoring the CRC32 For Season 05 and 06 back to old scheme For Season 07 ... ??? I guess it ignores the B in the CRC, but then I don't know where it's getting Episode 04 from For Season 08 ... ??? No clue... Season 4 Episode 8 would have made a semblance of sense For Season 11... back to old scheme For Season 30... I get the season from the start of the CRC but why Episode 09? is it ignoring the 12 in between? For Season 36... again, start of the CRC but why Episode 5? For Season 37 it makes... somewhat sense, yay? (37D04) For Season 44 .. uhm yea, I mean... 44C25 I guess but.... why episode 05? For Season 64 64E90 ... that's almost the SeasonEEpisode notation, why Episode 03? Does it ignore the 908? .. and the 9 after? For Season 242 I get the season but again why Episode 8, just ignoring the 16

... I should stop

Anyway, what I'm saying is ME should probably detect and ignore CRC32s, i.e. 8-digit alphanumeric strings that don't explicitely match one of the common Season-Episode formats. Most fansubs are using [ ] for them, however I have also seen ( ) before.

Ideally it would also be possible to retain the CRC32 and Release Group (although that one is tricky) when renaming and use both absolute and season-numbering in the filename. That would make it easier to use different scrapers depending on the setup. On something like Jellyfin you'd for example have the ability to have 2 libraries, one with an absolute-numbering scraper (like AniDB), and one with a season scraper like TMDb. A couple years back I made myself a naming format that worked well for this: SxxExx [group] 000 [CRC32] and Kodi was perfectly fine with that, I haven't tested with Jellyfin yet (I didn't have access to my stuff for a while).

One more thing: It would be super duper mega cool if we could have a mode where the renamer doesn't rename the actual file but instead creates a hard link (if possible, otherwise symlink) with an appropriate name. That would make it infinitely easier to continue sharing via BitTorrent clients since most Anime are distributed that way.

edit: Heh, this is funny :D So I did some shellscripting to add Season identifiers and such to the episodes, the filenames now look like

[joseole99] The Twelve Kingdoms - S01E - 01 (1440x1080 h264 AC3 AAC) [5ED2AC93].mkv

And it's seeing the correct seasons, but is still taking the episode out of the resolution :D

tew42 commented 7 months ago

The prior post seems a bit off-topic here, but I'm glad there's now a separate PR for it (definitely also helpful).

On topic though, I would also greatly appreciate support for TMDb "episode groups" feature - because this involves not only absolute order, but also DVD order etc. Among the available scrapers, this is the only one with multiple orders accessible, and I would find this super helpful (in my case, for Doctor Who, where I much prefer DVD order over having "Specials" as a separate category)

isoarpa commented 6 months ago

You are right! Thanks!

Tested it for Scrubs and The Simpsons but they don't have groups. Futurama on the other hand:

{
    "results": [
        {
            "description": "",
            "episode_count": 129,
            "group_count": 9,
            "id": "5ad2557a0e0a266c25015a52",
            "name": "DVD Order",
            "network": null,
            "type": 3
        },
        {
            "description": "",
            "episode_count": 128,
            "group_count": 10,
            "id": "5ad25f9b0e0a266c3101674b",
            "name": "Digital Order",
            "network": null,
            "type": 4
        },
        {
            "description": "",
            "episode_count": 130,
            "group_count": 8,
            "id": "5ad24bf4c3a3683eed0145a8",
            "name": "Production Order",
            "network": null,
            "type": 6
        }
    ],
    "id": 615
}

I'M hijacking this issue for TMDb. :-)

I'm exactly here pushing this because of Futurama :) I'd like to organize episodes following Production Order...

bugwelle commented 6 months ago

Hi all!

Sorry for the delayed response. I'm currently not able to look into this (due to time constraints; please see https://github.com/Komet/MediaElch/issues/1710).

If there are contributors out there who want to help, I'm happy to review any pull requests!

Regards, Andre