Rename files based on folder name.

Any questions? Need some help?
Post Reply
beedee
Posts: 10
Joined: 02 Aug 2012, 13:16

Rename files based on folder name.

Post by beedee »

What I want to do with my movies is to save the release information (most importantly source, release group and resolution (1080/720/SD)) and rename the folders containing my movies to "name (year)".

I thought of achieving this by renaming the movie files to the folder names and thereafter renaming the folders. Now, I found this post here about a "hack" to rename folders instead of movie files - so that's not a problem anymore. But is there a way to rename a movie file based on it's parent folder?

What I'm hoping to achieve with this is: Movies/Some Movie (2012)/Some.Movie.2012.1080p.BluRay.DTS.x264-SomeGroup.mkv



In a dream scenario, I'd like something like this - although I really don't know how to:

Some Movie (2012)/
Some Movie (2012).mkv
Some Movie (2012).srt
Some.Movie.2012.1080p.BluRay.DTS.x264-SomeGroup.nfo

That is, folder and movie name (and sub if available) renamed, but release info kept by renaming NFO to release name (or creating an empty NFO with release name if NFO is missing).
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename files based on folder name.

Post by rednoah »

Renaming folder/files is easy. Using mediainfo from the next best video file when formatting nfo filenames works in the latest test revisions. Can't create files though.

With scripting no problem, but maybe not quite how renaming is designed to work in some aspects.
:idea: Please read the FAQ and How to Request Help.
saidulhassan
Posts: 3
Joined: 18 Feb 2015, 04:58

Re: Rename files based on folder name.

Post by saidulhassan »

I'm looking for help achieving the same for some home video series by occasion or date. I need to rename files based on folder name and amend incremental text strings as in S01E01, S01E02, S2015E01, S2015E02 and the suffixing the original file name. If it helps you understand better, I am trying to do it for PLEX Media Server personal media library (home series media). The convention is described here https://support.plex.tv/hc/en-us/articl ... ries-Media

Example:
NOW:
Christmas/
Getting Ready.m4v
Stuffing the Stockings.m4v
Christmas Morning.m4v
AFTER:
Christmas/
Christmas - S2012E01 - Getting Ready.m4v
Christmas - S2012E02 - Stuffing the Stockings.m4v
Christmas - S2012E03 - Christmas Morning.m4v


Please note that I'd love to be able to insert in the syntax whatever I like to in the "S2012" part but the "E01" part would have to be automatic and incremental. I am pretty sure it's silly easy for who knows regex and etc. but for laymen like me, desperately seeking your help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename files based on folder name.

Post by rednoah »

1.
FileBot will match by episode title if SxE information is not available, so that's fine. And the rest is all in the format.

2.
You might also find the FAQ & video tutorials helpful.

3.
Your post is completely unrelated and has nothing to do with this topic. Why?
:idea: Please read the FAQ and How to Request Help.
saidulhassan
Posts: 3
Joined: 18 Feb 2015, 04:58

Re: Rename files based on folder name.

Post by saidulhassan »

rednoah wrote:1.
FileBot will match by episode title if SxE information is not available, so that's fine. And the rest is all in the format.

2.
You might also find the FAQ & video tutorials helpful.

3.
Your post is completely unrelated and has nothing to do with this topic. Why?
Hi @rednoah, apologies for posting on unrelated topic. You are right, FAQ & tutorials are helpful for me. Trust me, I tried but I guess I'm way too noob for this.

Now, 1. I don't think you actually understood my renaming situation or didn't quite read what I described above. Or maybe you did but aren't familiar with Home Series Media. I guess the confusion arose from my example of using SxE in the format. The thing is, those medias aren't any TV series or alike, those are personal videos. PLEX Media Server allows creating library of personal media in a series style but requires the naming style as my example to organize it (ref: the url above). So as you can see, I see no way for TVDB or anything to be able to recognize those titles and SxE. I am noob at such level that I even don't know if renaming personal media is possible with your application but while googling and browsing this forum I saw so much hi-level scripts and customization that I believed nothing is impossible with FileBot! What do you think?
I have about 6TB of movies, MP3 and TV shows all renamed and organized using your FileBot. I like to believe I know fairly okay how to rename using the GUI with predefined syntax that came with your awesome application!
2. I have been trying, maybe not enough. And I will be grateful if you/ anybody can point me to such FAQ/tutorials that address my situation.
3. I am sorry if my query is completely unrelated to this topic titled "Rename files based on folder name." I couldn't find better words to describe my situation than this. After all I am trying to achieve the same as the title or so I thought.
Say I have a folder for family videos that contains my cousin's weeding video clips. I want to organize it as
Kiera's Wedding:
/Kiera's Wedding - H01C01 - some descriptive texts
/Kiera's Wedding - H01C02 - some descriptive texts
/Kiera's Wedding - X02Y01 - some descriptive texts
/Kiera's Wedding - X02Y02 - some descriptive texts
/Kiera's Wedding - S2014E01 - some descriptive texts
/Kiera's Wedding - S2014E02 - some descriptive texts


While right now they are as:
Kiera's Wedding:
/some descriptive texts 1
/some descriptive texts 2
/some descriptive texts 3
/some descriptive texts 4
/some descriptive texts 5
/some descriptive texts 6


So what do you think? :) Or should I go to Plex forum and ask people about how to use Filebot? Wouldn't that be more unrelated than this is here? :?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename files based on folder name.

Post by rednoah »

Alright, you're talking about media that can't be matched to online records.

There's a solution for this as well, but it's more of an easter egg => http://www.filebot.net/forums/viewtopic.php?f=3&t=2072

If it works well for you please make a new thread and write a tutorial. ;)
:idea: Please read the FAQ and How to Request Help.
saidulhassan
Posts: 3
Joined: 18 Feb 2015, 04:58

Re: Rename files based on folder name.

Post by saidulhassan »

rednoah wrote:Alright, you're talking about media that can't be matched to online records.

There's a solution for this as well, but it's more of an easter egg => http://www.filebot.net/forums/viewtopic.php?f=3&t=2072

If it works well for you please make a new thread and write a tutorial. ;)
You are Godsend!!!
It was as silly as

Code: Select all

Folder Name - S01E{i.pad(3)} - {fn}
The trick was actually your instruction here.
Quote:
1. Drop files into Original Files
2. Click on the empty New Names component
3. Now that New Names has focus hit F2
4. New Names will instantly filled with File objects (or Episode / Movie objects if xattr metadata has previously been stored)
5. Double Click any item in New Names to apply a new Format Expression
To address my real situation where I will be doing this on hundreds folders, my syntax isn't a Format Expression, notice I will have to type the folder name on each renaming task. I know there must be an Expression that fetches the folder name. I understand it actually does that when I drag a folder of TV episodes where there is no series, season, episode name but just the episode number. Still this awesome beast finds the appropriate data from the online database from the folder name only. So bugging you for the last time, what do I replace with for the Folder Name part to make it my savior Format Expression?

PS. I sure am going to write that tutorial, even with screenshot for noobs like me :) I have come so far only 75%, tell us what we use to fetch the folder name and it will be a 100%, perfection. And btw, it didn't occur to me I can rename camera photos with this too. You are indeed an unmatched ingenious!!!

:idea: Optional & probably unrelated: While experimenting, I stumbled on situation where it warned when a file extension is missing. So I tried adding .ext at the end of the string but it didn't change extension for the files that already have extension, rather it added before the original extension, eg. somefile.mp4>>somefile.m4v.mp4. So wondering what do we need to do if we are to change extension too.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename files based on folder name.

Post by rednoah »

1.
Have you tried {folder} or {folder.name} yet?

2.
If you rename in "Override Extension" mode then files will be renamed to exactly what is specified via the format, including extension, so you can rewrite extensions via the format as well.
:idea: Please read the FAQ and How to Request Help.
Post Reply