Newbie Questions for use with Jellyfin

Any questions? Need some help?
Post Reply
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Newbie Questions for use with Jellyfin

Post by Hostile18 »

Hi all. Got a few newbie questions, so please answer like I'm 5 who has no idea about code lol.

Love the program so far. Four questions;

Question 1
When I change the name of my episodes it also relocated them to a new folder. So all episodes out of "Buffy the Vampire Slayer" will go to "Buffy the Vampire Slayer (1997)", it will then leave an almost empty shell where the episodes were. Is it possible to just rename the title folder to the latter, so I don't get two entries in my Jellyfin media folder?

This is the code it seems to use if it helps or needs modifying "{n} - {s00e00} - {t}{subt}"
If it needs modifying would really appreciate a copy and paste lol.

Question 2
I have my episodes down to this;

Z:/TV Shows/Buffy the Vampire Slayer (1997)/Season 01/Buffy the Vampire Slayer - S01E01 - Welcome to the Harvest

is there anyway to add the source so it looks like this (or very similar, not bothered about exact look or wording for source)

Z:/TV Shows/Buffy the Vampire Slayer (1997)/Season 01/Buffy the Vampire Slayer - S01E01 - Welcome to the Harvest (Amzn DL)

Question 3
I have NFO files in my jellyfin folder system. The new files created ignore the episode meta data folder and add pictures into the main episode structure. Which is the way Jellyfin is meant to be organised? If its not replacing the episode art how do I stop it? I do generally prefer this replaced episode art so happy to use that.

Question 4
I have custom Season and Show art work, is there any way to stop it replacing it? Perhaps this is a symptom of my earlier question, with it creating a new show folder?

Thank you for your time, I know its a lot, but I really like the program. :)
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

Answer 1
You'll want to organize files into a new structure / new parent folder. The new parent folder does not contain any folders when you set out, so you won't run into any left-over folder issues. See How do I organize files for Plex? for example. Everything that applies to Plex also applies to Jellyfin all the same. Just use {jellyfin.id} as format instead.


:idea: FileBot will delete left-behind empty folders, unless the left-behind folders are not empty. In those cases, the keep / delete decision is up to you. I'd process all the video files into a new structure and then delete all the left-behind folders all at once.

:idea: Renaming the folder is conceptually not possible because FileBot must account for the general case where files from one single source folder are moved into multiple different target folders.



Answer 2
You can inject Source Media information into the path generated by the {jellyfin.id} binding like so:

Format: Select all

Z:/{ jellyfin.id % { " [$source]" } }
:!: Note that your specific example of Amzn DL is notably not a recognized pattern. You could match information from the file path though:

Format: Select all

Z:/{ jellyfin.id % { ' [' + fn.match(/Amzn.DL/) + ']' } }


Answer 3
Jellyfin / Plex / Emby / etc can take care of everything themselves. You just need file paths generated by the {jellyfin.id} binding and then Jellyfin will take care of the rest, match movie / series, lookup information, fetch artwork, etc. FileBot notably does not generate artwork / nfo files by default.

:idea: You don't need to generate *.nfo and *.jpg files. FileBot can do it for you, if you like to have that readily available for yourself. You'll have to ask the Jellyfin manual in how far such files may (or may not) be used by Jellyfin.



Answer 4
Depending on how files are named and organized, FileBot may be able to process your existing companion files to some degree, Episode companion files and Movie companion at the very least. See Companion Files for details.

:!: You're likely out of luck with Season level and Series level artwork. A custom post-processing script could take care of generically moving / copying along some files from parent / parent parent folders as specified by you, but you would need some idea about code there.
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Wow, thank you for such a detailed response! I'll experiment with everything tomorrow. I have had a few hours to play around and I think I've worked out alot of my issues. This is the code I'm using now;

{'Season 0'+ s}/{n} ({y}) - {s00e00} - {t} ({vf} {Source} {hdr} {vc})

If I make sure Filebot doesn't change the top Show name folder (i.e add year in i.e "Buffy" to "Buffy 1997") it doesn't copy over into a new folder and no season art work is replaced. So the only manual bit I'm doing is adding "(1997)" to the top folder when naming is complete.

Only thing I haven't worked out yet, is if "Remux" can be added in if detected automatically. If does seem to go to "AVC" which I guess would only be that with a Remux file, so that might be good enough.

Episode picture wise, it deleted the "Metadata" folder in the season file that Jellyfin adds in and adds the episode screen caps in the main season directory instead. If I edit those screen caps in Jellyfin it recreates the "Metadata" folder but only contains the picture for what ever picture I've changed manually. I'll look in depth at what you said to try and work out the best solution with regards to this, ideally either all in the metadate folder within the season folder, or just in the season folder "loose".

Thanks again for taking time to give me such a detailed answer. :)
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

If you must keep the original folders, to keep the series artwork in the series folder and the season artwork in the season folder, then you'll want to only rename the file. Your proposed format may rewrite the season folder (i.e. create new "Season 01" folder if "Season 1" already exists) which is not what you want.

:idea: If your format only generates a file name, then FileBot will only rename files in place:

Format: Select all

{n} ({y}) - {s00e00} - {t} ({vf} {source} {hdr} {vc})

Hostile18 wrote: 22 May 2024, 21:40 If I make sure Filebot doesn't change the top Show name folder (i.e add year in i.e "Buffy" to "Buffy 1997") it doesn't copy over into a new folder and no season art work is replaced. So the only manual bit I'm doing
is adding "(1997)" to the top folder when naming is complete.
Rename Series Folders (i.e. add the {tmdb-id} marker to the folder name) will help you add the (year) bit. (NOTE: This will only work after you've already rename a few files inside with FileBot. Follow the link for details.)


Hostile18 wrote: 22 May 2024, 21:40 Only thing I haven't worked out yet, is if "Remux" can be added in if detected automatically. If does seem to go to "AVC" which I guess would only be that with a Remux file, so that might be good enough
Match information from the file path has you covered. Just add something like this to your format:

Format: Select all

{ '.' + fn.match(/PROPER|REMUX/) }
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Thank you I'm pretty much sorted now after experimentation. Just one last question please. I have group at the end in my code and it works perfectly for all but one encoder. It changes "Silence" to SILENCE for a reason I can't work out.

I see this might be the parameter I need, but I'm not quite sure how to insert it in? Do I put the {group} tag in those brackets or something else entirely? Could you modify mycode to change it how I want please? Or maybe so group is brought in exactly as it is in the file name? :)
String.lowerTrail()

My code is;
{n}/{'Season 0'+ s}/{n} ({y}) - {s00e00} - {t} ({vf} {Source} {hdr} {vc} {ac} {group})

Update sorted it. Took me ages of experimentation to realize you replace the word "string" lol. Is it general practice that Encoders names should be in all Caps? Because it seems quite mixed. I think a rule that lifts the exact text would be ideal, since there's no consistancy with regards to capital letters.
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

:idea: {group} will give you the standard case for the group at hand. The standard case for any one particular group may be lower-case, upper-case or mixed-case and any variation will get normalized to the standard case. Note that you can match information from the file path if {group} doesn't do what you want.


:arrow: Please read the Release Groups {group} manual for details and alternatives.
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Thank you. Looking at that release list I know why I was having a problem just with Silence. The table is wrong for that group members entry. It should be "Silence" as listed in all their files on their release website, rather than what is listed here as "SILENCE". All other QxR members are correct as far as I can see. :)
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

Unfortunately, we don't allow dictionary entries. Lots of movie names start with or end with "Silence". The upper-case / mixed-case variation is much less likely to mismatch. This is a FileBot limitation.

:idea: You can however match information from the file path if your files already follow a clean pattern:
rednoah wrote: 16 Nov 2011, 14:41 e.g. match -group at the end of the filename:

Format: Select all

{ fn.match(/[-]([^-]+)$/) }
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

{ jellyfin.id }/{n} ({y}) - {s00e00} - {t} ({vf} {source} {vc} {hdr} {group})

{ fn.group(/[-]([^-]+)$/) }

Would this be the code I'd copy in for the group to be spelt/capitalised exactly from the file? Sorry haven't full got my head above the basics. The top line is the code I'm using, so I'd just add in the second line, with "match" replaced with "group"?
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Edit I seem to be getting a lot of these the last hour. Stopping pulling data on any of my codes that were previously working (pretty sure I didn't change anything).
Fetch failed: Try again in 8 seconds (1 more) => net.filebot.web.HttpServerError: https://api4.thetvdb.com/v4/login [502 Bad Gateway]
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

e.g. just add it to your format:

Format: Select all

{n} - {s00e00} - {t} { fn.match(/[-]([^-]+)$/) }

e.g. use {jellyfin} operators as seen in Answer 2 above:

Format: Select all

Z:/{ jellyfin.id % { fn.match(/[-][^-]+$/) } }



Hostile18 wrote: 24 May 2024, 08:59

Code: Select all

Fetch failed: Try again in 8 seconds (1 more) => net.filebot.web.HttpServerError: https://api4.thetvdb.com/v4/login [502 Bad Gateway]
TheTVDB servers were down at the time. If that's the only error message you see, then FileBot did a retry 8 seconds later and was then successful the second time around.

:!: I strongly recommend using TheMovieDB instead. Presumably, that's what Jellyfin uses by default. You definitely want to use the same database in both FileBot and Jellyfin. Please read the How do I organize files for Jellyfin? guide for details.
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Thank you! To be honest I thought it was pulling from TheMovieDB as that is what my Jellyfin uses. How do I set it to that? I see on the right hand side you can select source but I had been just loading up my saved code in the left hand side window. Do I need to load it and then in the right window select TheMovieDB each time I rename something?

Sorry I didn't realise I would have so many questions when I started lol.
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

You click TheMovieDB and not TheTVDB:

Screenshot


:idea: Clicking the Episode Mode: TheMovieDB button will instruct FileBot to look at the files that you have currently loaded into Original Files and match them to Episode objects from TheMovieDB. Your format is then applied to each File / Episode match to generate the target file path.


:idea: Your format is notably unrelated to the database where you get your series / episode information from.
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Thank you, I'm not sure how TVDB was ever selected, perhaps once as a mistake is all I can think, In any case its running smoothly now. Thank you for all your help, its much appreciated.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

rednoah wrote: 24 May 2024, 09:59 e.g. just add it to your format:

Format: Select all

{n} - {s00e00} - {t} { fn.match(/[-]([^-]+)$/) }

e.g. use {jellyfin} operators as seen in Answer 2 above:

Format: Select all

Z:/{ jellyfin.id % { fn.match(/[-][^-]+$/) } }

{drive}/{ jellyfin.id }/{n} ({y}) - {s00e00} - {t} ({vf} {hdr} {Source} {vc} {group})

I'm really struggling with this trying to insert that code in to work pulling only the group name as is. Tried for like 2 hours to get it to work. I only want the Group name to be used as it is in the file, but all I get is a variety of duplicate data or things missing or everything lifted off the file as is, making it pointless. I think just changing the group name to text of what I want it is the only reliable way I can get it to work.

Crucially I don't know what this { fn.match(/[-]([^-]+)$/) } means so its really hard to inset it just where it needs to be or modify it, where's the individual variables are really easy to manage. Above my skills I think :(
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

:idea: Each {...} will return a value which is then used in the file path. { fn.match(/[-][^-]+$/) } matches the regular expression pattern [-][^-]+$ from the file name. You can see the entire { fn.match(/[-][^-]+$/) } bit as a single atomic variable that you can copy & paste without understanding what it does:

Console Output: Select all

filebot -mediainfo *.mkv --format "{ fn } | { fn.match(/[-][^-]+$/) }"
avatar-silence | -silence

:idea: {jellyfin} notably generates the entire file path including the file name. That's why we use operators to change the file path before returning the result:

Console Output: Select all

$ filebot -list --q alias --db TheMovieDB::TV --format "{ jellyfin.id } | { n } | { y } | { s00e00 } | { t }"
TV Shows/Alias (2001) [tmdbid-2046]/Season 01/Alias (2001) - S01E01 - Truth Be Told | Alias | 2001 | S01E01 | Truth Be Told





:arrow: {jellyfin} makes some things easier (generate the whole file path at once) but makes other things harder (modify bits and pieces of the file path here or there) but in this particular case we can start with one of the examples:
rednoah wrote: 12 Sep 2016, 10:03 e.g. Avatar (2009) {tmdb-19995}/Avatar (2009) {edition-Extended Edition} [720p, x264, AAC]

Format: Select all

{ ~plex.id % { " {edition-$edition}" } % { " [$vf, $vc, $ac]" } }
And then modify this to our needs:

Format: Select all

{ jellyfin.id % { " (" } % { "$vf" } % { " $hdr" } % { " $source" } % { " $vc" } % { fn.match(/[-][^-]+$/) } % { ")" } }

Code: Select all

Movies/Avatar (2009) [tmdbid-19995]/Avatar (2009) (480p x264-Silence)
:idea: Notably, I did % { "$vf" } % { " $hdr" } % { " $source" } instead of % { " [$vf, $hdr, $source" } because hdr and source may be individually undefined. See The Unwind-on-Undefined Behaviour for details.
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Thank you, I'd of never got this myself lol.

Using that last code, its almost there, I get this;

Z:\TV Shows\TV Shows\Reacher (2022) [tmdbid-108978]\Season 01\Reacher (2022) - S01E06 - Papier (1080p BluRay x265- Papier (1080p BluRay x265 Ghost)
When Ideally I'd of thought it should come out like this;
Z:\TV Shows\TV Shows\Reacher (2022) [tmdbid-108978]\Season 01\Reacher (2022) - S01E06 - Papier\Reacher S01E06 - Papier (1080p BluRay x265 Ghost)

Bolded just to show the difference, BluRay, x265 mentioned twice in the file name, also the episode folder path ends in a ) rather than a \ etc. My desired ouputs using my code come out like this;

Z:/TV Shows/Loki (2021) [tmdbid-84958]/Season 01/Loki (2021) - S01E06 - For All Time. Always/Loki (2021) - S01E06 - For All Time. Always. (1080p AMZN WEB-DL x265 SILENCE)

Z:/TV Shows/Better Call Saul (2015) [tmdbid-60059]/Season 03/Better Call Saul (2015) - S03E01 - Mabel/Better Call Saul (2015) - S03E01 - Mabel (1080p AMZN WEB-DL x265 SILENCE)

Literally just the group name being all caps where is shouldn't be causing me problems.
User avatar
rednoah
The Source
Posts: 23468
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Newbie Questions for use with Jellyfin

Post by rednoah »

If you read the {group} binding manual then you will see the code we have copied:
rednoah wrote: 16 Nov 2011, 14:41 If your files are already uniformly well-named, then you can directly match arbitrary release group names from the filename.

e.g. match -group at the end of the filename:

Format: Select all

{ fn.match(/[-]([^-]+)$/) }
The regular expression /[-]([^-]+)$/ notably only works if your files are already uniformly well-named, i.e. your code can just match the -group pattern at the end of the file name. As in "find the last - dash character and then copy & paste from there" which naturally does not work if your files do not use -group at the end of the file name. It'll still do "find the last - dash character and then copy & paste from there" though, except the last - dash character happens to be before the episode title in the sample file path above.

You can use regexr to easily visualize what is happening:
https://regexr.com/80re6

:idea: If you want to match something) at the end of the file name and not -something at the end of the filename, or both, or both and more variations that you have not shared, then the regex pattern that matches all these variations while avoiding false positives will get tricky fast. Possible of course, but perhaps not easy, depending on your exact requirements. That's why we have the {group} binding.



:arrow: tl;dr just use {group} because it'll mostly work for mostly any kind of input file path. Possibly not getting the exact lower-case / upper-case letters is the price you pay for simplicity.
:idea: Please read the FAQ and How to Request Help.
Hostile18
Posts: 12
Joined: 22 May 2024, 07:32

Re: Newbie Questions for use with Jellyfin

Post by Hostile18 »

Yeah I was using the QxR group structure, applying it to all my files.

Was renaming files all day yesterday. As a work around I created a preset for each name that it would otherwise change. It was only something like 3 encoders "Ghost", "Silence" and "Panda". Also have a preset for Remux files.

Worked well, although ready for a relaxing break after going through 200 tv shows lol.
Post Reply