Nested folders causing issue with renaming

Support for macOS users
Post Reply
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Nested folders causing issue with renaming

Post by cheaters »

OK. I am so close to having what I want, but of course I hit a snag. Not sure if this is intended behavior but when renaming a movie that is in a folder within a collection folder, the movie get's moved to a new folder instead of staying in place. Before hitting "Rename" the Rename Window shows the correct path - but it doesn't end up there. Here is my formula:

Code: Select all

 /Volumes/Movies/Rated-{any{imdb.certification}{certification} {'NR'}}/{any{collection.upperInitial().colon('-')+'/'}{}}{ny.colon(' - ').replace('?', '')} {[certification]} {[runtime + ' min']} {(genres ?: ['No Genre'])*.replace('Science Fiction', 'Sci-Fi').take(4)} {[imdbid, rating]}
The path to the file before renaming is /Volume/Movies/Rated-G/collection/movieFolder/movie.mp4

After I rename with the above formula only the movie file ends up in a newly created directory: /Volumes/Movies/movieFolder/movie.mp4

I am thinking the issue is this bit but don't know why

Code: Select all

/{any{collection.upperInitial().colon('-')+'/'}{}}
I used the {} for an empty result. Is this incorrect?

Before this, when I originally renamed all my files FileBot created the directories correctly and moved files into the appropriate places. Some of the files were not renamed by FileBot. Now I am trying to name those files. I thought it was a xattr issue, so I cleared them all.

I am also running into an issue with FileBot attempting to rename multiple .srt files in the same directory and as expected a duplicate warning. I would rather not have it alter the title of the .srt files when dragging files into FileBot.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Nested folders causing issue with renaming

Post by cheaters »

I have a screen shot of the history window if it helps.
https://goo.gl/3KQB6s
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Nested folders causing issue with renaming

Post by rednoah »

1.
You say that there is no Rated-X folder, but the screenshot clearly shows that there is a Rated-G folder. It also shows a collection folder, which will be missing if the movie does not belong to any collection.

Your format is responsible for the destination path, including any folder separators. The screenshot you posted looks good to me. What's the problem?

You don't need any{}{} if you don't have any alternatives. This expression will work when there is a collection, and have no value if there is no collection (and thus not produce an extra folder level):

Code: Select all

collection.upperInitial().colon('-') + '/'

2.
Your format is responsible for coming up with a unique file path for each subtitle. Adding {subt} at the end will do the trick for most people (as long as you only have one subtitle per language).
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Nested folders causing issue with renaming

Post by cheaters »

I don't think I can explain it any better in writing. I have two screen recordings that show what's happening.
https://goo.gl/iyt9mK uses the following formula:

Code: Select all

/Volumes/Movies/Rated-{any{imdb.certification}{certification} {'NR'}}/{any{collection.upperInitial().colon('-')+'/'}{}}{ny.colon(' - ').replace('?', '')} {[certification]} {[runtime + ' min']} {(genres ?: ['No Genre'])*.replace('Science Fiction', 'Sci-Fi').take(4)} {[imdbid, rating]}
https://goo.gl/uHMHjs uses the following formula:

Code: Select all

{any{collection.upperInitial().colon(', ')+'/'}{}}{ny.colon(' - ').replace('?', '')} {[certification]} {[runtime + ' min']} {(genres ?: ['No Genre'])*.replace('Science Fiction', 'Sci-Fi').take(4)} {[imdbid, rating]}
Except,, I just noticed there is a path in the "…no/Path" formula. :roll: Still, the first formula should keep everything in the same spot and not move things to new directories at the root, I used that formula to put the files were they are now without issue. Shouldn't it just duplicate the process, but rename the movie file :? ? Running low on sleep now.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Nested folders causing issue with renaming

Post by rednoah »

I've looked at the recordings but I don't notice anything particularly odd.

Please post the following information:

1. What is the absolute path you have?
2. What is the absolute path you want?
3. What is the absolute path you get, but don't want?


:idea: If you use a relative path, then FileBot will try to guess the appropriate base folder from where that relative path should be applied, which depends on the existing folder structure. I recommend using absolute formats to avoid potential issues with guessing the appropriate base folder.
:idea: Please read the FAQ and How to Request Help.
cheaters
Posts: 214
Joined: 09 Oct 2016, 02:01

Re: Nested folders causing issue with renaming

Post by cheaters »

[quote]The path to the file before renaming is /Volume/Movies/Rated-G/collection/movieFolder/movie.mp4[/quote]

[quote]After I rename with the above formula only the movie file ends up in a newly created directory: /Volumes/Movies/movieFolder/movie.mp4[/quote]

When you watch the movie you will see that a new directory is created at /Volume/Movie/. That's not what I wanted. I wanted the file to stay in it's current directory if it there is no "collection" directory and if there is a "collection" directory stay inside that directory.

.Volume
↳ Movies Directory
____↳Rated-G Directory
________↳Collection Directory (if there is one)
________|___↳Movie Directory
________|______↳File
________↳Movie Directory
___________↳File


I sort of solved it by making a second script that has no directory information in it, but I would rather have just one script that works when I drag the entire mass into FileBot.

I was trying to use tabs above and spaces but BBCode didn't take it. Not sure how to add empty spaces.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Nested folders causing issue with renaming

Post by rednoah »

1.
If your format is relative, then FileBot will probably pick /Volume/Movies as base directory and resolve each relative destination path against that.

2.
A format such as this will definitely create the file tree structure you describe above:

Code: Select all

/Volume/Movies/Rated-{any{certification}{'NR'}}{'/'+collection}/{ny}/{ny}
:idea: Please read the FAQ and How to Request Help.
Post Reply