• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions Automatically put files with similair names in a folder together

     
    • 0 Vote(s) - 0 Average

    Automatically put files with similair names in a folder together

    Superdurt
    Offline

    Junior Member

    Posts: 4
    Threads: 2
    Joined: 2023 Sep
    Reputation: 0
    #1
    2024-01-17, 05:18 PM
    Before I really understood all the possibilities of JF I thought is was a good idea to have a single folder with my whole movie collection in it but now I want to have all the movies in their own separate folder (easier to manage the cover files, subtitles, etc.). I did a lot already bij manually selecting the files and placing them into folders but with a lot of movies to go I wonder if there is an easier, less labour intensive way to do this. Even if it automates half of what I still need to do it's worth it for me.
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #2
    2024-01-17, 05:24 PM (This post was last modified: 2024-01-17, 05:34 PM by tmsrxzar. Edited 2 times in total.)
    i did this to move single movie files to a subfolder of the same name

    movie.title.here.2008.mkv -> movie.title.here.2008/movie.title.here.2008.mkv

    can be modded to do movie.title.here.2008.*

    *edit: only for linux

    bash:

    Code:
    for f in *.mkv; do
    mkdir ${f//.mkv/}
    echo mv "$f" ${f//.mkv/}/
    done

    python:

    Code:
    import os, re
    for e in os.listdir('.'):
        if '.mkv' in e:
            dname = re.split('(\.\d{4})(.*)',e)
            dname = '%s%s' % (dname[0],dname[1])
            try:
                os.mkdir(dname)
            except: pass
            os.system('mv ./%s ./%s/' % (e, dname))
    Superdurt
    Offline

    Junior Member

    Posts: 4
    Threads: 2
    Joined: 2023 Sep
    Reputation: 0
    #3
    2024-01-17, 05:34 PM
    I'm running W11 on this box but I might be able to translate this to a Windows CMD script. Thanks for your reply!
    tmsrxzar
    Offline

    Senior Member

    Posts: 755
    Threads: 6
    Joined: 2023 Nov
    Reputation: 20
    #4
    2024-01-17, 05:36 PM
    probably pretty easy, list files of *.mkv, replace the filename's extension and use it for the directory name, make directory, move everything with that filename to the new subdir, repeat

    it's been years since i did a batch file for microsoft
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode