this post was submitted on 12 Jul 2026
16 points (100.0% liked)

Linux Questions

4088 readers
3 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 3 years ago
MODERATORS
 

I have a rather large library of movies gathered over the years (all entirely legally I assure you officer). I'm in the process of setting up a Jellyfin server so I can stream them on the go.

Currently it's just one folder full of individual files but Jellyfin wants each movie within it's own folder.

Is there a command, or set of commands, that would do this all in one go? ie iterate my way through a folder, create a new folder with the same name as a file, move that file into this new folder and repeat a few hundred times.

I am using Cachy OS (arch) and have Dolphin and yazi as file managers if that helps. I guess a bash script would be the best way to achieve this but my skills are quite rusty.

top 13 comments
sorted by: hot top controversial new old
[–] homes@piefed.world 4 points 2 weeks ago* (last edited 2 weeks ago)

Do you use radarr to manage movie downloads? Because it has a manual import tool that will scan your movies folder and manually import them, and that will also rename all of your files and put them into individual folders, if you set it up correctly. This will handle everything for you. It can even perform this task in bulk, which I think is pretty amazing.

[–] Winning@lemmy.world 4 points 2 weeks ago (2 children)

It does? I don't do that with my jellyfin library. Are your file names ok? I just have 27 folders #A-Z and sort by first letter, ignoring A/The but keeping it in place in the filename. Works great

I know the file manager Double Commander has a built in multi renamer that would be able to do this if you still want to.

[–] Denjin@feddit.uk 5 points 2 weeks ago

The wiki advises a certain naming convention and folder structure (as linked by another user) and it's a useful exercise in giving all my media a consistent structure as managing it personally has become a bit of a nightmare.

[–] ryannathans@aussie.zone 4 points 2 weeks ago (1 children)
[–] vithigar@lemmy.ca 4 points 2 weeks ago (1 children)

This isn't strictly necessary. My movies library is a mix of both loose files and folders and works just fine.

[–] Onomatopoeia@lemmy.cafe 4 points 2 weeks ago (2 children)

As your library grows, or becomes more complex, or contains anything that's difficult to differentiate, Jellyfin will struggle to properly identify.

With well-named folders (release date, imdbid), my Jellyfin server still has issues where it will mis-identify some things that arent mainstream. Old movies are specifically problematic, as are rare titles that have any similarity to something more popular.

Using the folder naming structure reduced mis-identification tremendously.

[–] ryannathans@aussie.zone 5 points 2 weeks ago

Protip: find the tvdb/omdb ID and stick it in the name if having issues still (see docs)

[–] vithigar@lemmy.ca 1 points 2 weeks ago (1 children)

Well, yes, but you can get exactly the same result by having well-named files as well. Having them well-named in general makes identification more reliable, regardless of whether it's the full path or just the filename.

[–] Onomatopoeia@lemmy.cafe 1 points 2 weeks ago

No, you can't.

With my 500 movies and several hundred TV series, that does not work.

Jellyfin mis-identifies a significant portion of it doing this.

Only by using the named folders (with year and imdbid) does it get 90% right.

And I've had this across 5 Jellyfin servers in the last year - I've done a LOT of testing.

[–] Infernal_pizza@lemmy.dbzer0.com 2 points 2 weeks ago (1 children)

Why does Jellyfin want each movie in its own folder? I've just dumped everything in one folder and it works fine

[–] ryannathans@aussie.zone 3 points 2 weeks ago

See link I posted

[–] ryannathans@aussie.zone 1 points 2 weeks ago (1 children)

xdofor is your tool, and maybe a hint of regex

[–] Onomatopoeia@lemmy.cafe 1 points 2 weeks ago

Regex is a game changer.