TMDB - get absolute number for specials

All your suggestions, requests and ideas for future development
Post Reply
Bazzu85
Posts: 53
Joined: 16 Nov 2016, 19:28

TMDB - get absolute number for specials

Post by Bazzu85 »

Hi,

I don't understand how tmdb episode aboslute number works.
For this show 80020
For S03E01 filebot return absolute 20 but on trakt is listed as 3x01 (21)
https://www.themoviedb.org/tv/80020-dra ... /episode/1
https://trakt.tv/shows/super-dragon-bal ... episodes/1

S00E01 return no absolute but on trakt is listed as Special 1 (20)
https://www.themoviedb.org/tv/80020/season/0/episode/1
https://trakt.tv/shows/super-dragon-bal ... episodes/1

testing the swagger from here
https://developer.themoviedb.org/refere ... de-details
I can't find the absolute number

can you explain a bit how it works?
User avatar
rednoah
The Source
Posts: 23922
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TMDB - get absolute number for specials

Post by rednoah »

:!: TMDB has an identifying one true SxE number for each episode. There is no intrinsic one true absolute episode number for each episode, so you will not find one in the base episode record. There are however Absolute type episode groups. There could be none. There could be one. There could be two or more.



:idea: The numbers you see when you select Episode Order: Absolute are from the Absolute order (Absolute) episode group and in this case there luckily is only one single Absolute type episode group: https://www.themoviedb.org/tv/80020-dra ... 00c38731a3

Console Output: Select all

$ filebot -list --q 80020 --db TheMovieDB::TV --order Absolute --format "{absolute} | {sxe} | {t}"
...
19 | 19 | Ultimate Conclusion! The Universal Conflict Ends!
20 | 20 | Decisive Battle! Time Patrol vs Dark King!
21 | 21 | The Gods of Destruction Invade! The Beginning of a New Battle!
22 | 22 | Fu's Plan! The Threat of the Dreadful Universal Tree!
...
NOTE: a series on TMDB can have no Absolute type episode groups, and can also have multiple Absolute type episode groups



:idea: If you select Episode Order: Airdate with TMDB, but then use {absolute} in your format, then that absolute number is the absolute number of that episode in that episode list:

Console Output: Select all

$ filebot -list --q 80020 --db TheMovieDB::TV --order Airdate --format "{absolute} | {sxe} | {t}"
filebot -list --q 80020 --db TheMovieDB::TV --order Airdate --format "{absolute} | {sxe} | {t}"
1 | 1x01 | Goku vs. Goku! A Super Battle Begins on Prison Planet!
2 | 1x02 | Goku Goes Berserk! The Evil Saiyan's Rampage!
3 | 1x03 | The Mightiest Radiance! Vegito Blue Kaio-ken Explodes!
...
19 | 2x13 | Ultimate Conclusion! The Universal Conflict Ends!
20 | 3x01 | The Gods of Destruction Invade! The Beginning of a New Battle!
21 | 3x02 | Fu's Plan! The Threat of the Dreadful Universal Tree!
...


:idea: You can use {order.absolute.sxe} to cross-reference episode information from a different episode order like so:

Console Output: Select all

$ filebot -list --q 80020 --db TheMovieDB::TV --order Airdate --format "{order.absolute.sxe} | {absolute} | {sxe} | {t}"
...
19 | 19 | 2x13 | Ultimate Conclusion! The Universal Conflict Ends!
21 | 20 | 3x01 | The Gods of Destruction Invade! The Beginning of a New Battle!
22 | 21 | 3x02 | Fu's Plan! The Threat of the Dreadful Universal Tree!
...


:idea: Alternatively, TheTVDB does include an absolute number in base the episode record so that might work better for your specific use case:

Console Output: Select all

$ filebot -list --q "Dragon Ball Heroes" --db TheTVDB --order Airdate --format "{absolute} | {sxe} | {t}"
...
19 | 2x13 | Ultimate Conclusion! The Universal Conflict Ends!
21 | 3x01 | The Gods of Destruction Invade! The Beginning of a New Battle!
...
:idea: Please read the FAQ and How to Request Help.
Bazzu85
Posts: 53
Joined: 16 Nov 2016, 19:28

Re: TMDB - get absolute number for specials

Post by Bazzu85 »

Hi,
thx for explaining it to me!
the {order.absolute.sxe} works but only when there's not an absolute (ex One piece S00E07).
How can I test if {order.absolute.sxe} return a value so I can decide if use it or not?
User avatar
rednoah
The Source
Posts: 23922
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TMDB - get absolute number for specials

Post by rednoah »

Bazzu85 wrote: 26 Apr 2025, 22:56 How can I test if {order.absolute.sxe} return a value so I can decide if use it or not?
:?: What is your use case?


e.g. add [20] to the file name if order.absolute.sxe is defined:

Format: Select all

{ ' [' + order.absolute.sxe +']' }
e.g. since Absolute Order is just a preference, you might get the SxE number instead of the Absolute number if there is no Absolute number (i.e. {sxe} is always defined} so you could probably write code like this to check for that:

Format: Select all

{ order.absolute.sxe =~ /x/ ? 'Episode does not have an Absolute Number' : ' [' + order.absolute.sxe +']' }
See Learn how {expressions} work and useful Helper Functions for details.
:idea: Please read the FAQ and How to Request Help.
Post Reply