Renaming Music Videos
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Renaming Music Videos
Here’s my situation. I have a very large library of music videos, roughly 30,000-35,000 of them. In the earlier days of collecting, I adopted a naming convention that emphasized short filenames and a limited character set so that my videos would work with a serial-controlled computerized playback system that would choke on funky characters and long strings.
Almost 15 years later, my Windows NT-based Video Jukebox is long gone, replaced by the more modern media centre software Plex, and I want to likewise upgrade my filenames so they are more intelligible, searchable, and matchable to metadata providers. (I actually run a site that provides music video metadata - http://www.rockpeaks.com/web-services - via an API, and plan on building an agent for Plex, but that’s another story).
Here’s how my folder system is structured and files currently named:
/Music Video
------> /A
------> /B
------> /C
------> /Cabaret Voltaire
------> /Cage the Elephant
------> /Cake
------> /Cale, John
------>1975 06-07 - Crystal Palace Park
------>Cale_John_01_Fear_is_a_Man's_Best_Friend_Crystal_Palace_Park_75.mpeg
------>Cale_John_02_Buffalo_Ballet_Crystal_Palace_Park_75.mpeg
------>1985 - Old Grey Whistle Test
------>Cale_John_Dying_On_The_Vine_OGWT_85.mpeg
So you can see that while my folder names have spaces in them, my filenames do not, using underscores instead. And while the folder name has the full show name and full date, I very often abbreviated both in the filename itself to shorten its length. And where there is a sequence number to preserve the sort or playback order, those double-digit numbers come after the artist name.
The convention I’d ideally like to adopt for filenames going forward is this:
01 - John Cale - Fear Is A Man’s Best Friend - Crystal Palace Park - 1975.mpg
What I’d like to do is automate the following as much as possible (realizing that a certain amount of manual intervention is inevitable, and not all of this may be possible).
It seems to make sense to me to work from back to front on the filenames, given how they are structured. So:
(1) Convert to four digit years. The logic, as best as I can express it, would be something like this. Look for two digit numerals towards the end of a filename string and where the first of the digits is 2 or greater, prepend “ - 19”. If the the leading digit is less than 2, prepend “ - 20”.
This would result in the first of the files above having the new name:
Cale_John_01_Fear_is_a_Man’s_Best_Friend_Crystal_Palace_Park - 1975.mpeg
A couple of caveats. In some cases, the filename may already have a four digit year, in which case just the replacing of the underscore with a “ - “ would be required.
In some other cases, the year numerals are not the last characters before the file extension. Example:
ACDC_It’s_A_Long_Way_To_The_Top_Bandstand_76_(digital_rebroadcast).mpeg
(2) Very often the show name is abbreviated, as mentioned. Ideally, we would be able to grab the full show name from the containing folder, look for a full or partial partial match in the filename, and replace that match with the full name and a leading “ - “ , giving us:
Cale_John_01_Fear_is_a_Man’s_Best_Friend - Crystal Palace Park - 1975.mpeg
A potential issue with this one: Sometimes matching based on similar sequences of characters will be difficult or perhaps impossible, since an abbreviation has been used (Like the example above of “OGWT” for “Old Grey Whistle Test”). However, a limited number of abbreviations tend to occur frequently, I.e. TOTP for Top Of The Pops, SNL for Saturday Night Live etc.. so perhaps there is a way to draw on a reference table of common abbreviations?
(3) The third step would be to determine the division point between the song name and the artist name and place a “ - “ there. I could see how In cases where the two digit sequence numbers are present this would be easier, but there are lots of circumstances where there is just a single clip. In those cases, might it be possible to rely on a third-party matching service for artist names perhaps? Or maybe we go two levels up the folder tree and grab the name from there?
Or maybe this is a case where I would simple have to manually identify the division point once for an artist, and then for the remaining clips in that folder, Filebot would follow the same pattern? While I use the format "Last Name, First Name" for proper artist names in the folders, I would like to swap the order for the filenames themselves, and have a consistent and universally recognized exact spelling and formatting for artist names.
(4) The last step would be to swap the remaining underscores for spaces, and move the sequence numbers (if present) before the artist name instead of after it.
Thanks in advance for your help!
Barn
Re: Renaming Music Videos
So the new filename is entirely based on known information (folder name, file name, custom text mappings) right? No music identification necessary at all?
The FileBot Format for that might be quite long, but I'm pretty sure it's doable even within the UI:
viewtopic.php?f=3&t=2072
2.
Let's just take one file as an example, and get started with that:
Code: Select all
Music Video/C/Cale, John/1975 06-07 - Crystal Palace Park/Cale_John_01_Fear_is_a_Man's_Best_Friend_Crystal_Palace_Park_75.mpeg
Code: Select all
Letter/Artist/Year-Album/Artist_Number_Title_Album_Year
3.
Paste this Generic File Format and see what happens:
Code: Select all
{
def artist = file.dir.dir.name.tokenize(',')*.trim().join(' ');
def year = fn.matchAll(/\d{2,4}/).last();
def number = fn.before(year).match(/\d{2}/);
def album = file.dir.name.after(' - ');
def title = fn.before(year).after(number).space(' ').before("${album}|${album.acronym()}");
[artist, number, album, title, year.pad(4, '19')].join(' -- ')
}
Right now we're just testing if can extract all the information for each file correctly. Once we have confirmed that we can get all the variables correctly, we can get started on building the exact output path pattern you want.
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
To answer your questions:
Yes, that is correct, no music identification necessary.rednoah wrote:1.
So the new filename is entirely based on known information (folder name, file name, custom text mappings) right? No music identification necessary at all?
Pretty close. Where you have the word "Album" I would substitute the word "Show". Also, not every video has a sequence number. And the date in the containing folder can vary depending on how much info there is about a clip. Sometimes it is just the four-digit year, sometimes it also includes the month and day as well.rednoah wrote:So this is the folder structure right? Is this correct? Is it always the same for all files?
Code: Select all
Letter/Artist/Year-Album/Artist_Number_Title_Album_Year
But otherwise, this is pretty much correct:
Letter/Artist/Year Month-Day - Show/Artist_Number_Title_Show_Year
Here is what I got as a result with the first example using the code snippet you provided:rednoah wrote:3.
Paste this Generic File Format and see what happens:
Cale John -- 01 -- Crystal Palace Park -- Fear is a Man's Best Friend -- 1975
Pretty good! We have definitely succeeded in extracting all the information correctly.
Ways I could see to improve things would include:
• Switching the order of the Show and the Title
• Moving the sequence number to the first position
• Switching the order to First Name Last Name
For this last request, the code would first need to make sure the artist was a person and not a band name, I suppose the method would be to check if the name had two words and that there was a comma immediately after the first word.
I tried a second time on this file:
C/Cale, John/1985 - Old Grey Whistle Test/Cale_John_Dying_On_The_Vine_OGWT_85
And got the message "ScriptException: java.lang.Exception: Pattern not found"
This could be due to the lack of a sequence number. Other differences are that the containing folder only has the year (no month or day) and that the show name is abbreviated in the filename.
Very encouraged by the progress so far!
Re: Renaming Music Videos
Alright, I've added this to my test data:
Code: Select all
Music Video/C/Cale, John/1985 - Old Grey Whistle Test/Cale_John_Dying_On_The_Vine_OGWT_85.mpeg
Please try this with another set of files:
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',').reverse()*.trim().join(' ');
def year = fn.matchAll(/\d{2,4}/).last();
def number = any{fn.before(year).match(/\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def title = fn.before(year).after(number).space(' ').before("${show}|${show.acronym()}");
[number, artist, title, show, year.pad(4, '19')].findAll{ it.length() > 0 }.join(' -- ')
}
What folder structure do you want?
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
Code: Select all
John Cale -- Cale John Dying On The Vine -- Old Grey Whistle Test -- 1985
I tested the new snippet with the earlier file and it worked perfectly:
Code: Select all
01 -- John Cale -- Fear Is A Man's Best Friend -- Crystal Palace Park -- 1975
Code: Select all
Music Video/C/Cale, John/2003 - BBC Sessions St. Lukes
Cale_John_02_Ship_Of_Fools_BBC_St_Lukes_2003
The output I got was:
Code: Select all
02 -- John Cale -- Ship of Fools BBC St Lukes -- BBC Sessions St Lukes -- 2003
Here's another fairly common example:
Code: Select all
Music Video/C/Cale, John/2003 10-03 - Later with Jools Holland
Cale_John_Venus_in_Furs_Later_03
Code: Select all
John Cale -- Cale John Venus in Furs Later -- Later with Jools Holland -- 1903
The short show name "Later" gets included with the title again.
And the year is off by 100 years My original thinking to get around this problem was:
Regarding folder structure, there don't need to be any changes there. I just need to make sure my artist names and my show names are exactly as I want them, which I'll have to double-check manually.Look for two digit numerals towards the end of a filename string and where the first of the digits is 2 or greater, prepend “ - 19”. If the the leading digit is less than 2, prepend “ - 20”.
Re: Renaming Music Videos
2. Artist/Reverse issue has been fixed.
Try this:
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def year = file.dir.name.match(/\d{4}/);
def trail = "${year}|${year[2..3]}";
def number = any{fn.before(trail).match(/\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def title = fn.space(' ').before(trail).after(artist.join(' ')).after(number).before("${show}|${show.acronym()}");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
3. The "BBC St Lukes" VS "BBC Sessions St Lukes" issue is tricky. I could try to cut off at "BBC", meaning we assume the the title won't contain the first word of the show, which seems questionable.
Try this:
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def year = file.dir.name.match(/\d{4}/);
def yearTrail = "${year}|${year[2..3]}";
def number = any{fn.before(yearTrail).match(/\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def showTrail = "${show}|${show.acronym()}|${show.tokenize().first()}";
def title = fn.space(' ').before(yearTrail).after(artist.join(' ')).after(number).before("($showTrail)(?!.*($showTrail))");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
Your second code snippet does indeed render the BBC St Luke's filename correctly. And the other issues are fixed as you say.
I have tried the final snippet on a bunch of files at random and had very good results. There are a few exception conditions here and there, but these are unique naming cases and it does not make sense to try and code around them.
However, I did want to ask you about one thing, which is where there are numerals in the band name or the clip's title: that seems to break things. Again, I can live with it if it is too tricky to code around, but I thought I would just ask. Here are some examples:
Code: Select all
Babes in Toyland
1995 07-09 - 120 Minutes
Babes_in_Toyland_Sweet_69_120_Minutes_95
Code: Select all
69 -- Babes in Toyland -- 120 Minutes -- 1995
And this one:
Code: Select all
B-52s
1998 08 - VH1 Big Backyard BBQ
B52s_01_Introduction_VH1_Big_Backyard_BBQ_1998
Code: Select all
52 -- B-52s -- s 01 Introduction -- VH1 Big Backyard BBQ -- 1998
Re: Renaming Music Videos
Making a few more assumptions based on the examples I've got so far:
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def artistHead = artist.join(' ').replaceAll(/\W|_/, '.?');
def year = file.dir.name.match(/\d{4}/);
def yearTrail = "${year}|${year[2..3]}";
def number = any{fn.space(' ').before(yearTrail).after(artistHead).match(/^\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def showTrail = "${show}|${show.acronym()}|${show.tokenize().first()}";
def title = fn.space(' ').before(yearTrail).after(artistHead).after(number).before("($showTrail)(?!.*($showTrail))");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
If you want to "edit" the target name in FileBot before renaming you can do that as well by hitting F2 on selected items.
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
If you're feeling up to some further tweaks however....
For some reason:
Code: Select all
B52s_03_Private_Idaho_Big_Backyard_BBQ_1998
B52s_04_Channel_Z_Big_Backyard_BBQ_1998
B52s_05_Good_Stuff_Big_Backyard_BBQ_1998
Code: Select all
03 -- B-52s -- Private Idaho Big Backyard BBQ -- VH1 Big Backyard BBQ -- 1998
04 -- B-52s -- Channel Z Big Backyard BBQ -- VH1 Big Backyard BBQ -- 1998
05 -- B-52s -- Good Stuff Big Backyard BBQ -- VH1 Big Backyard BBQ -- 1998
Code: Select all
B52s_02_Party_Out_Of_Bounds_VH1_Big_Backyard_BBQ_1998
I have spent a bunch more time testing. One other thing I have noticed is that when there is a comma in a show name, the part after the comma gets appended to the title.
Example:
Code: Select all
1985 07-13 - Live Aid, JFK Stadium
Beach_Boys_01_Wouldn't_It_Be_Nice_JFK_Stadium_85.mpeg
Code: Select all
01 -- Beach Boys -- Wouldn't It Be Nice JFK Stadium -- Live Aid, JFK Stadium -- 1985
And finally, I have experimented with dropping entire Artist folders on Filebot, to gauge the speed with which I'll be able to work through my collection. I also keep non-video files in folders (DVD art, text info files) and I was pleased to see that I could easily just exclude them by clicking the red 'X" at the bottom of the program window.
Here's a sample of a whole artist drop:
Code: Select all
Barenaked Ladies
2001 - Intimate and Interactive
Barenaked_Ladies_01_Intro_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_02_The_Old_Apartment_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_03_Pinch_Me_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_04_Jane_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_05_Interview_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_06_One_Week_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_07_Ad_Lib_Gluehead_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_08_What_a_Good_Boy_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_09_Discussion_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_10_Its_All_Been_Done_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_11_Brian_Wilson_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_12_Interview_2_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_13_Falling_for_the_First_Time_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_14_If_I_Had_a_Million_Dollars_Intimate_and_Interactive_01.mpeg
Barenaked_Ladies_15_Call_and_Answer_Intimate_and_Interactive_01.mpeg
BNL I&I 2001.txt
IntimateandInteractive.jpg
2001 02 - VH1 Grammys Preview
Barenaked_Ladies_Grammys_Nominees_VH1_Grammys_Preview_01.mpg
BNL I&I 2001.txt
2001 02-15 - Live with Regis and Kelly
Barenaked_Ladies_01_Intro_Live_with_Regis_and_Kelly_01.mpg
Barenaked_Ladies_02_Too_Little_Too_Late_Live_with_Regis_and_Kelly_01.mpg
Barenaked_Ladies_03_Outro_Live_with_Regis_and_Kelly_01.mpg
Barenaked_Ladies_04_Interview_Live_with_Regis_and_Kelly_01.mpg
Barenaked_Ladies_05_The_Old_Apartment_Live_with_Regis_and_Kelly_01.mpg
Barenaked_Ladies_06_Its_All_Been_Done_Live_with_Regis_and_Kelly_01.mpg
Barenaked_Ladies_07_One_Week_Live_with_Regis_and_Kelly_01.mpg
BNL I&I 2001.txt
2001 12-06 - AV Squad
AVSquad.jpg
Barenaked_Ladies_01_Interview_AV_Squad_01.mpeg
Barenaked_Ladies_02_Ad_Lib_AV_Squad_01.mpeg
Barenaked_Ladies_03_Interview_2_AV_Squad_01.mpeg
Barenaked_Ladies_04_One_Week_AV_Squad_01.mpeg
BNL I&I 2001.txt
2006 - Tonight Show With Jay Leno
Barenaked_Ladies_Wind_It_Up_Leno_06.mpg
Code: Select all
Barenaked Ladies -- Intimate and Interactive -- 2001
02 -- Barenaked Ladies -- The Old Apartment -- Intimate and Interactive -- 2001
03 -- Barenaked Ladies -- Pinch Me -- Intimate and Interactive -- 2001
...
Barenaked Ladies -- Live with Regis and Kelly -- 2001
02 -- Barenaked Ladies -- Too Little Too Late -- Live with Regis and Kelly -- 2001
03 -- Barenaked Ladies -- Outro -- Live with Regis and Kelly -- 2001
...
Thanks for the tip on hitting F2 to rename a file - very useful! (One observation: the dialog box that pops up is very narrow and one has to scroll a lot within it. Ideally it would show as much of the filename as possible)
Thank you so much for your help on this rednoah, I was dreading this job, and thanks to your excellent program and generous help it is going to be much easier. A donation is coming your way right now.
Re: Renaming Music Videos
* Match title before any show sub pattern
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def artistHead = artist.join(' ').replaceAll(/\W|_/, '.?');
def year = file.dir.name.match(/\d{4}/);
def yearTrail = "(${year}|${year[2..3]})(?!.*(${year}|${year[2..3]}))";
def number = any{fn.space(' ').before(yearTrail).after(artistHead).match(/^\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def showTrail = [show.tokenize().reverse().inject{t, h -> "(($h ($t)?)|$t)" }, show.acronym()].join('|');
def title = fn.space(' ').before(yearTrail).after(artistHead).after(number).before("($showTrail)(?!.*($showTrail))");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
Barndotcom
Re: Renaming Music Videos
Here's my test data in case anybody wants to play with this, and see how we got to a good-enough solution step by step:
Code: Select all
Music Video/C/B-52s/1998 08 - VH1 Big Backyard BBQ/B52s_01_Introduction_VH1_Big_Backyard_BBQ_1998.ts
Music Video/C/B-52s/1998 08 - VH1 Big Backyard BBQ/B52s_03_Private_Idaho_Big_Backyard_BBQ_1998.ts
Music Video/C/Babes in Toyland/1995 07-09 - 120 Minutes/Babes_in_Toyland_Sweet_69_120_Minutes_95.ts
Music Video/C/Barenaked Ladies/2001 - Intimate and Interactive/Barenaked_Ladies_01_Intro_Intimate_and_Interactive_01.mpeg
Music Video/C/Beach Boys/1985 07-13 - Live Aid, JFK Stadium/Beach_Boys_01_Wouldn't_It_Be_Nice_JFK_Stadium_85.mpeg
Music Video/C/Cale, John/1975 06-07 - Crystal Palace Park/Cale_John_01_Fear_is_a_Man's_Best_Friend_Crystal_Palace_Park_75.mpeg
Music Video/C/Cale, John/1985 - Old Grey Whistle Test/Cale_John_Dying_On_The_Vine_OGWT_85.mpeg
Music Video/C/Cale, John/2003 - BBC Sessions St. Lukes/Cale_John_02_Ship_Of_Fools_BBC_St_Lukes_2003.mpeg
Music Video/C/Cale, John/2003 10-03 - Later with Jools Holland/Cale_John_Venus_in_Furs_Later_03.mpeg
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
I do notice after some time using the latest code that the comma issue still persists in some cases, placing what preceded the comma into the clip title.
This renames fine:
Code: Select all
1991 9-28 - Tushino Airfield, Moscow
01 -- ACDC -- Back In Black -- Tushino Airfield, Moscow -- 1991
Code: Select all
1983 12-12 - Landover, MD
01 -- ACDC -- Flick Of The Switch Landover -- Landover, MD -- 1983
Re: Renaming Music Videos
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def artistHead = artist.join(' ').replaceAll(/\W|_/, '.?');
def year = file.dir.name.match(/\d{4}/);
def yearTrail = "(${year}|${year[2..3]})(?!.*(${year}|${year[2..3]}))";
def number = any{fn.space(' ').before(yearTrail).after(artistHead).match(/^\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def showTrail = [show.replaceAll(/\p{Punct}/, '.?').tokenize().reverse().inject{t, h -> "(($h ($t)?)|$t)" }, show.acronym()].join('|');
def title = fn.space(' ').before(yearTrail).after(artistHead).after(number).before("($showTrail)(?!.*($showTrail))");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
Code: Select all
1983 10-30 - The Summit, Houston Texas
ACDC_Shoot_To_Thrill_Houston_83.mpeg
Code: Select all
ACDC -- Shoot To Thrill Houston -- The Summit, Houston Texas -- 1983
Code: Select all
1996 7-5 - VH1 Studio B, London, England
ACDC_Gone_Shootin_London_96.mpeg
Code: Select all
ACDC -- Gone Shootin London -- VH1 Studio B, London, England -- 1996
Re: Renaming Music Videos
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def artistHead = artist.join(' ').replaceAll(/\W|_/, '.?');
def year = file.dir.name.match(/\d{4}/);
def yearTrail = "(${year}|${year[2..3]})(?!.*(${year}|${year[2..3]}))";
def number = any{fn.space(' ').before(yearTrail).after(artistHead).match(/^\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def showTrail = [show.replaceAll(/\p{Punct}/, '.?').tokenize().reverse().inject{t, h -> "(($h ($t)?)|$t)" }, show.tokenize(',')*.trim()*.tokenize(' ')*.first().join('|'), show.acronym()].join('|');
def title = fn.space(' ').before(yearTrail).after(artistHead).after(number).before("($showTrail)(?!.*($showTrail))");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
I have just spent two hours happily renaming files, and have no other issues to report with regards to the renaming code.
I do have a couple of observations about the FileBot UI that you may want to consider the next time you make an update to the program.
One is my earlier observation about the width of the dialog box that comes up when you press F2 to manually rename a file - it would be great if it were wider.
It would also be nice if the up/down keyboard arrow keys functioned to move the highlight bar through the list of files in the active window pane. My workflow involves dropping a large number of folders + subfolders on FileBot and then removing the ones I don't want renamed. Currently this involves a lot of mouse movement to go between the file and the red X below, and it would be much faster if I could use both the keyboard and the mouse in tandem.
Normally I drop an entire Artist folder, with many sub-folders on FileBot without any problem. However, if I select two or more folders that are at the same level in my HD directory tree and drop them on FileBot, all the files appear twice for some odd reason.
All of these are very minor quibbles, and may be unique to the particular way I am using the program, but I just thought I would pass along the feedback.
Overall, you have written an amazingly useful application, and your support is outstanding. I thank you again for all your help red noah!
Barn
Re: Renaming Music Videos
The F2 "Edit Name" feature can't be made resizable (unless I change 1 line to many lines). Also, with a perfect format you should even need manually edit a name in the first place.
2.
UP/DOWN moves the selection up and down. DELETE removes the selected row. There is no need to use the mouse when checking through matches. Is that not working for you?
3.
I can't reproduce the drag-n-drop issues you describe. What operating system are you using? What application are you dragging files from?
You say dragging folders A and B into FileBot will result in 4 files being added into list?
Code: Select all
A/a.txt
B/b.txt
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
Regarding #2, I didn't think to try the delete key (duh) so I was toggling between the up down keys and the red x (with the mouse), and thus the window was losing focus, which is why I thought the up down keys were not working. All good now, just using the keyboard.
#3 is not something that I can reproduce consistently, and may have been a weird temporary anomaly. if I find I can reproduce, I'll let you know.
Thanks again! Back to renaming.....
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
I've just returned to FileBot after some months away from my renaming task, and started to pick up where I left off. Using the same syntax you developed above (07 Feb 2016 post has the latest code) I am now getting "[Expression yields empty value: null]" when trying to rename for some reason.
I have not changed anything in terms of my original file naming, folder structure convention etc.. I did update my Mac OS to 10.12.6, and possibly FileBot itself has been updated since I last tried (running 4.7.12 (5176)
I'm sure it is something simple that I'm missing, or have forgotten. Any ideas? Not sure exactly how to use the "Groovy Pad" you mention when trying to debug in the GUI...
Re: Renaming Music Videos
Path/file demo
outputCale, John\1975 06-07 - Crystal Palace Park\Cale_John_01_Fear_is_a_Man's_Best_Friend_Crystal_Palace_Park_75.mpeg
using this code = look fine to me ?01 -- John Cale -- Fear is a Man's Best Friend -- Crystal Palace Park -- 1975
Code: Select all
{
def artist = file.dir.dir.name.space(' ').tokenize(',')*.trim();
def artistHead = artist.join(' ').replaceAll(/\W|_/, '.?');
def year = file.dir.name.match(/\d{4}/);
def yearTrail = "(${year}|${year[2..3]})(?!.*(${year}|${year[2..3]}))";
def number = any{fn.space(' ').before(yearTrail).after(artistHead).match(/^\d{2}/)}{''};
def show = file.dir.name.after(' - ').space(' ');
def showTrail = [show.replaceAll(/\p{Punct}/, '.?').tokenize().reverse().inject{t, h -> "(($h ($t)?)|$t)" }, show.tokenize(',')*.trim()*.tokenize(' ')*.first().join('|'), show.acronym()].join('|');
def title = fn.space(' ').before(yearTrail).after(artistHead).after(number).before("($showTrail)(?!.*($showTrail))");
[number, artist.reverse().join(' '), title, show, year].findAll{ it.length() > 0 }.join(' -- ')
}
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
Thanks for taking the time to check this. Things are working for me now, I wasn't following the procedure correctly before.
Barnaby
-
- Donor
- Posts: 19
- Joined: 27 Jan 2016, 23:43
Re: Renaming Music Videos
In some renaming contexts I'm now stripping away most of the old filename, leaving just a signal digit or double digit number and the file extension, i.e.
1.mp4
2.mp4
...
11.mp4 etc.
I would love it if the code above could be tweaked to allow for files with this simple naming to be renamed as well, currently I get the 'Expression yields empty value' message when I try.
Thank you,
Barnaby
Re: Renaming Music Videos
to what ?
Code: Select all
{
any{def artist
...
.join(' -- ')}{fn}
}
you really need to do something... cant even post SAME CODE AS ABOVE
BAD REQUEST
Re: Renaming Music Videos
Unfortunately, since this is running on a shared host, I don't control the WAF configuration files...
EDIT:
Maybe we can maintain example format snippets at a centralized location in GitHub?
https://github.com/filebot/docs
EDIT 2:
I've started something here. I'll add you as contributor if you PM me your GitHub ID:
https://github.com/filebot/docs/blob/ma ... /format.md
Editing via GitHub should be easy, but organizing things might be tricky after a while, though we've given up on that here on the forums as well, can't be helped.