Freaky renamer settings for better sorting of HUGE collections and performance boost
#1
Not a big deal, just some IF...ELSE decisions...but kind of cool stuff (imho) for better usability outside of KODI and as a hack for performance boost in some cases.
...Hopefully helpful for someone...

If you use this settings on windows, change "/" to "\" cuz i am on linux....
...AND ALWAYS double check your settings and result preview....
...NO WARRANTY... It should not hurt your pet, but who knows...

For more details, please press the help button (renamer settings) and read the wiki for JMTE: https://gitlab.com/tinyMediaManager/tiny...wikis/JMTE


For a more freaky version with chronically movieset sorting read post #6

The what:
  • you can have the same movie multiple times in different audio/video formats (SD/HD/3D) without any errors
  • it works for episodes too, even if not fully supported at the moment. E.g. ${3Dformat} for episodes seems not to be supported. But when, read below....
  • movies are sorted in collection|set directory (IF) present, otherwise they will be sorted in alphabetical subfolders
  • movies starting with a number, or special characters, will be sorted in directory "#"
  • all relevant information is given, so you could reset your database, reimport and rescrape all files easily (TMM and KODI). Even without any nfo files (at least for movies. IMDB_id is not supported for episodes)
  • kind of performance boost, read further...

The why:
  • if you try to access your files outside of KODI, usability will suffer as the collection grows. Yay, let's scroll through hundreds of entries.
  • to be able to have multiple versions (e.g. dummy file for a 3D Bluray AND the non 3D version)
  • to avoid errors, or accidentally overwriting a movie file with another movie format, but still to be able to search for duplicated content
  • TMM performance: the larger the amount of entries in a directory, the longer it takes to enumerate. Not only because of TMM, but this is done by Os (or NAS) and it takes its time. Listing too many files/subdirectories in one directory (noticeable at ~ some hundert - 1000 entries, depending on Hardware/OS/settings) will slow down any file manager, that's the same issue. Listing same amount of files by changing to separated directories is much faster.
  • So I do not recommend to put too many files or directories into one directory.

The warning:
As you will see, reading media info has to be done first, or renaming may fail. We need those details.

3D tagging:
TMM can not recognize 3D formats. This has to be done manually in "Details 2".
But renamed files can be imported correctly without appropriate nfo, as TMM recognize "3D" in filenames (tested with tmm 3.1.2).

Proof of concept with TMM:
TMM does recognize imdb id in filenames. So importing renamed files is very easy.
Just place any file in your collection directory and rename it to e.g. "Lord of War_tt0395699.mp4"
Now rescan your collection, select the new file and press search & scrape. You will get "The Pacifier (2005)", which is the right movie for tt0395699.
So there is no need to worry as long as you have the valid imdb id in your filename, which this renaming setting does.

Proof of concept with KODI:
Also scraping with online scrapers will work well.
Two dummy files based on output scheme of this renamer and no nfo files. A good challenge, as the titles are the same:
Code:
total recall_(1990)_tt0100802_h264-576p_AAC.mp4
total recall_(2012)_tt1386703_h264-576p_AAC.mp4
Kodi -> scan for new content -> tmdb scraper gets the right movies automatically.


------------------------------------------------------------------
Renamer settings for movies:
directory:
Code:
${if movieSet.titleSortable}${movieSet.titleSortable}/${else}${movie.titleSortable;first}/${end}${titleSortable}_(${year})_${videoformat}${_,3Dformat,}
files:
Code:
${title}_(${year})_${imdb}_${videocodec}-${videoFormat}_${audioCodec}${_,3Dformat,}
------------------------------------------------------------------
Example result for a movie, but 4 different formats:
titleSortable is used, so "A Collection" will become "Collection, A" and "A Movie" will become "Movie, A"
Movie in a collection:
Code:
/Collection, A/Movie, A_(YEAR)_1080p_3D/A Movie_(YEAR)_tt123456_h264-1080p_AAC_3D.ext
/Collection, A/Movie, A_(YEAR)_1080p/A Movie_(YEAR)_tt123456_h264-1080p_AAC.ext
/Collection, A/Movie, A_(YEAR)_576p/A Movie_(YEAR)_tt123456_h264-576p_AAC.ext
/Collection, A/Movie, A_(YEAR)_720p/A Movie_(YEAR)_tt123456_h264-720p_AAC.ext

Collection not set:
titleSortable is used, so "A Movie" will become "Movie, A" and first character will be "M"
Code:
/M/Movie, A_(YEAR)_1080p_3D/A Movie_(YEAR)_tt123456_h264-1080p_AAC_3D.ext
/M/Movie, A_(YEAR)_1080p/A Movie_(YEAR)_tt123456_h264-1080p_AAC.ext
/M/Movie, A_(YEAR)_576p/A Movie_(YEAR)_tt123456_h264-576p_AAC.ext
/M/Movie, A_(YEAR)_720p/A Movie_(YEAR)_tt123456_h264-720p_AAC.ext

------------------------------------------------------------------
Renamer settings for Tv shows:

Tv show directory:
Code:
${showTitle}
Season directory:
Code:
Season ${seasonNr2}
Episode file:
Code:
${showTitle}_S${seasonNr2}E${episodeNr2}_${title}_${videocodec}-${videoFormat}_${audioCodec}

*tmm 3.1.2 seems not to support 3D tag for episodes. Assuming ${3Dformat} could be the right thing, the following line could create a different filename with 3D tag, (IF) present
Episode file:
Code:
${showTitle}_S${seasonNr2}E${episodeNr2}_${title}_${videocodec}-${videoFormat}_${audioCodec}${_,3Dformat,}
------------------------------------------------------------------

Example result:
Code:
/TVSHOW/Season01/TVSHOW_S01E01_EPISODE_h264-576p_AAC.ext
/TVSHOW/Season01/TVSHOW_S01E01_EPISODE_h264-720p_MP3.ext
/TVSHOW/Season01/TVSHOW_S01E01_EPISODE_h264-576p_AAC_3D.ext*
#2
Thank you very much, is very useful.
Does kodi by default read the IMDb id of the title or do I have to change something?
#3
Happy to help.

Yes, Kodi reads imdb id like tmm does.
You have two options:
  • You scrape your files with TMM and use the local file scraper of Kodi as usual -> preferred one, as you want to use this freaky renamer settings
  • Or you use any online scraper of Kodi (IMDB/TMDB). Kodi will have the same result.
You only need a valid id in your filename, that's it.

See how it works:
Just place any file in your collection directory and rename it to e.g. "Lord of War_tt0395699.mp4"
Now rescan your collection, select the new file and press search & scrape. You will get "The Pacifier (2005)", which is the right movie for tt0395699.
#4
I tried with test_tt7286456.mkv (Joker) but doesn't work here, kodi doesn't recognize it
#5
Ok, i have to correct myself.....Kodi seems to search for title and year first. But anyway, it works like a charm.

Two dummy files based on output scheme of my renamer and no nfo files. A good challenge, as the titles are the same:
  • total recall_(1990)_tt0100802_h264-576p_AAC.mp4
  • total recall_(2012)_tt1386703_h264-576p_AAC.mp4
Kodi -> scan for new content -> tmdb scraper gets the right movies automatically.
#6
V2:
Sometimes movies in moviesets are not numbered, so you may want some kind of indexing. Movies in moviesets are now sorted chronically
Moviesets are now also sorted in alphabetical subfolders, which makes searching even easier.


Folder name:
Code:
${if movieSet.titleSortable}${movieSet.titleSortable;first}/${movieSet.titleSortable}/${year}_${title}_${videocodec}-${videoFormat}_${audioCodec}${_,3Dformat,}/${else}${movie.titleSortable;first}/${titleSortable}_(${year})_${videocodec}-${videoFormat}_${audioCodec}${_,3Dformat,}${end}

Filename:
Code:
${title}_(${year})_${imdb}_${videocodec}-${videoFormat}_${audioCodec}${_,3Dformat,}

An example result with some dummy files:
Code:
.
├── #
│   └── 2 Guns_(2013)_h264-576p_AAC
│       ├── 2 Guns_(2013)_tt1272878_h264-576p_AAC-fanart.jpg
│       ├── 2 Guns_(2013)_tt1272878_h264-576p_AAC.mp4
│       ├── 2 Guns_(2013)_tt1272878_h264-576p_AAC.nfo
│       ├── 2 Guns_(2013)_tt1272878_h264-576p_AAC-poster.jpg
│       └── 2 Guns_(2013)_tt1272878_h264-576p_AAC-thumb.jpg
├── D
│   └── Dark Knight Collection, The
│       ├── 2005_Batman Begins_h264-720p_AAC
│       │   ├── Batman Begins_(2005)_tt0372784_h264-720p_AAC-fanart.jpg
│       │   ├── Batman Begins_(2005)_tt0372784_h264-720p_AAC.m4v
│       │   ├── Batman Begins_(2005)_tt0372784_h264-720p_AAC.nfo
│       │   ├── Batman Begins_(2005)_tt0372784_h264-720p_AAC-poster.jpg
│       │   └── Batman Begins_(2005)_tt0372784_h264-720p_AAC-thumb.jpg
│       ├── 2008_The Dark Knight_h264-720p_AC3
│       │   ├── The Dark Knight_(2008)_tt0468569_h264-720p_AC3-fanart.jpg
│       │   ├── The Dark Knight_(2008)_tt0468569_h264-720p_AC3.m4v
│       │   ├── The Dark Knight_(2008)_tt0468569_h264-720p_AC3.nfo
│       │   ├── The Dark Knight_(2008)_tt0468569_h264-720p_AC3-poster.jpg
│       │   └── The Dark Knight_(2008)_tt0468569_h264-720p_AC3-thumb.jpg
│       ├── 2012_The Dark Knight Rises_h264-1080p_AAC
│       │   ├── The Dark Knight Rises_(2012)_tt1345836_h264-1080p_AAC-fanart.jpg
│       │   ├── The Dark Knight Rises_(2012)_tt1345836_h264-1080p_AAC.mp4
│       │   ├── The Dark Knight Rises_(2012)_tt1345836_h264-1080p_AAC.nfo
│       │   ├── The Dark Knight Rises_(2012)_tt1345836_h264-1080p_AAC-poster.jpg
│       │   └── The Dark Knight Rises_(2012)_tt1345836_h264-1080p_AAC-thumb.jpg
│       └── 2012_The Dark Knight Rises_h264-720p_AC3
│           ├── The Dark Knight Rises_(2012)_tt1345836_h264-720p_AC3-fanart.jpg
│           ├── The Dark Knight Rises_(2012)_tt1345836_h264-720p_AC3.m4v
│           ├── The Dark Knight Rises_(2012)_tt1345836_h264-720p_AC3.nfo
│           ├── The Dark Knight Rises_(2012)_tt1345836_h264-720p_AC3-poster.jpg
│           └── The Dark Knight Rises_(2012)_tt1345836_h264-720p_AC3-thumb.jpg
└── R
    ├── Red Planet_(2000)_h264-1080p_AAC
    │   ├── Red Planet_(2000)_tt0199753_h264-1080p_AAC-fanart.jpg
    │   ├── Red Planet_(2000)_tt0199753_h264-1080p_AAC.mp4
    │   ├── Red Planet_(2000)_tt0199753_h264-1080p_AAC.nfo
    │   ├── Red Planet_(2000)_tt0199753_h264-1080p_AAC-poster.jpg
    │   └── Red Planet_(2000)_tt0199753_h264-1080p_AAC-thumb.jpg
    ├── Red Planet_(2000)_h264-720p_AAC_3D
    │   ├── Red Planet_(2000)_tt0199753_h264-720p_AAC_3D-fanart.jpg
    │   ├── Red Planet_(2000)_tt0199753_h264-720p_AAC_3D.m4v
    │   ├── Red Planet_(2000)_tt0199753_h264-720p_AAC_3D.nfo
    │   ├── Red Planet_(2000)_tt0199753_h264-720p_AAC_3D-poster.jpg
    │   └── Red Planet_(2000)_tt0199753_h264-720p_AAC_3D-thumb.jpg
    └── Red Planet_(2000)_h264-720p_AC3
        ├── Red Planet_(2000)_tt0199753_h264-720p_AC3-fanart.jpg
        ├── Red Planet_(2000)_tt0199753_h264-720p_AC3.m4v
        ├── Red Planet_(2000)_tt0199753_h264-720p_AC3.nfo
        ├── Red Planet_(2000)_tt0199753_h264-720p_AC3-poster.jpg
        └── Red Planet_(2000)_tt0199753_h264-720p_AC3-thumb.jpg

#7
THANKS for your hints; I will link them into the additional information thread
tinyMediaManager - THE media manager of your choice - available for Windows, macOS and Linux
Help us translate tinyMediaManager at Weblate | Translations at 66%
Found a bug or want to submit a feature request? Contact us at GitLab
#8
Glad it's helpful. The thanks goes to you, because without tmm it would not have been possible at all.

Logout Mark Read Team Forum Stats Members Help
Freaky renamer settings for better sorting of HUGE collections and performance boost2