Folder Renamer
#1
Hi

Strange behavior from "Renamer Pattern" setting : 

1/ when I leave it empty, the movie file stays in the directory where it is : fine !

2/ I would like to move it ONLY if its source field is not empty
  • ${if mediaSource <> ''}${movie.dateAdded;date(yyMMdd)}-${mediaSource}${end}
    a) moves it to the specified directory when the source field is not empty : fine !
    b) BUT moves it to the top directory when the source field is empty : why ?
  • ${if mediaSource = ''}${path}${else}${movie.dateAdded;date(yyMMdd)}-${mediaSource}${end}
    has the same strange behavior : tMM moves it to the top directory when the source field is empty : why ?

THANKS for your help !!!
Reply
#2
I think the easiest solution would be only select movies with media source using filter and rename only those, especially when your current movie folder naming is inconsistent.

Your code has several problems. For #1, it doesn't have ${else} part, so no folder is created for those without media source, which means they get moved out of their current folder that's removed. For #2, ${path} should be ${movie.path}, so currently it's treated empty just like #1.
Now if you use ${movie.path}, it will use the whole path which won't work either. You will need to remove data source part (the whole parent folders) from path using replace renderer. When creating the renderer, you will need to take into account the colon setting in advanced options and backslashes are getting auto-removed.
Another problem with your code is your movies with media source won't keep their own current folder when they get moved under a new parent folder unless that's what you intended.
Better approach would be using a consistent and easily configurable folder naming for every movie instead of using the problematic "current" folder name which can, at best, be used only once.
Reply
#3
that is no strange behaviour, that is intended:

if you leave the input field empty, the whole logic is not being executed. If you fill the input field with some data, it is processed (even if the output is empty!)
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
Reply
#4
Thanks tars & mlaggner, for your help but : 
  • I really want to use renamer
  • so I corrected my mistakes*
  • and it works fine ... EXCEPT I have an "_" that I can't get rid of
    example : if the initial directory is
    C:\MOVIES\test
    I get with ${if mediaSource = ''}${movie.path; replace (_Racement.csv)}${else}${movie.dateAdded; date (yyMMdd)}-${mediaSource}${end}
    C:\MOVIES\_test

* I'm a newbie for JTME but ...
1/ why ${mediaSource} works fine (it would be : ${movie.mediaSource} ?
2/ how to apply 2 renderers at the same time ? Example : ${movie.releaseDate;date(yyyy-MM-dd);replace(_Remplacement.csv)} does not work !

THANKS for your help !
Reply
#5
Up ?
Reply
#6
How could anyone know without knowing your colon setting and the content of the replace renderer you're using?

For #1, if something doesn't work, try full syntax.
For #2, Only a single render is allowed per token. You could try creating your own date renderer using replace renderer but without the support of regex what you can do will be pretty limited.
Reply
#7
1. you should not use ${movie.path} in your patterns, because this is being "calculated" in the renamer...
2. maybe something in the _Replacement replaces a part of the movie.path with the underscore?
3. chaining tokens is not possible in jmte (but why do you need a replacement in the date renderer if you can fully customize the date format?!
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
Reply
#8
THANKS tars & mlaggner for your respective answers

1/ if I am not using ${movie.path}, how can I rename my folder ONLY if mediaSource is not empty ?
2/ I think that it is "\" which causes problem because it is replaced AFTER any treatment by " ". BUT like tars said, my folder pattern can, at best, be used only once (probably due to 1/)
3/ date renderer was just an example ;o)

THANKS for your HELP ... 
(I do not know how to deal with this anymore)
Reply
#9
1) either change your workflow so that you only rename movies with the media source or
2) adopt your renamer pattern so that the movies without the media source get renamed into the way you want it to...

tmm is designed to generate all of that.... either create _all_ folder names or none...
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
Reply
#10
THANKS for your answer mlaggner  (that I understand)

I just regret that in the expression
${if mediaSource <> ''}${{movie.dateAdded; date(yyMMdd)}-${mediaSource}${end}
if the condition is false, then tMM does not react as if there was no expression (Cf. my 1st POST) ...
Reply



Logout Mark Read Team Forum Stats Members Help
Folder Renamer0
This forum uses Lukasz Tkacz MyBB addons.