SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-13-2012, 07:25 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Utility: Phoenix Tools - Phoenix Renamer

I've released a new, command line, tool for renaming media files (tv and movies only for now). mkanet originally asked if I had time to do so, and I worked with him to iron out the kinks. I'm releasing it here in the event that others may find it useful.


Source Code

Features
  • Renames files and directories
  • Renames associates files (ie, properties, sub titles, etc)
  • Works for both TV and Movies
  • Completely stand alone (ie, doesn't require SageTV)
  • Can provide a custom tv or movie rename mask to customize the renamed file
  • Works on DVDs and BluRay Rips
  • Mult-Platform (windows/linux/mac)
  • Includes a .exe to easily run in windows (.sh on linux)
  • Can use a different output folder for TV or Movies
  • Can execute a script on success or failure (ie, call a script when rename happens)
  • Ability to run and watch a directory for new files, and then rename them, once they arrive, and are not being written to

The GitHub homepage has more in depth documentation on how to use the renamer
https://github.com/stuckless/phoenix-renamer

Last edited by stuckless; 10-03-2015 at 02:52 PM.
Reply With Quote
  #2  
Old 02-14-2012, 08:26 AM
ChaOConnor's Avatar
ChaOConnor ChaOConnor is offline
Sage Aficionado
 
Join Date: Nov 2008
Location: Bel Air, MD
Posts: 355
Thank you for this! I will be giving it a try later. Appreciate all you do!
__________________
Server: AMD Phenom II X6 1090T 3.2GHz, ASRock 890FX Deluxe4 890FX, PNY Optima 8GB DDR3 1333
Media Storage: Rosewill RSV-S4-X 4 Bay Enclosure w/ 4 x 3TB via unRAID
Capture: HDHomerun Prime, HDHomerun x 2
Software: Sage Server 7.1.9 on Windows 7 (Virtualized in ESXi)
Clients: i3-2105, ASRock Z68 Pro3-M, 4GB DDR3 1600, 64GB SATA III (OS), 2TB WD Green (Recording), PNY GT 430 // 2 x HD-300
Reply With Quote
  #3  
Old 02-14-2012, 10:39 AM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Looks pretty sweet. I have quite a few files with really really old bmt info in them that the name of the actual metadata title is the unc path and file name. Will this tool fix that?
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA
Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60
Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u
Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup.
Reply With Quote
  #4  
Old 02-14-2012, 12:16 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Quote:
Originally Posted by panteragstk View Post
Looks pretty sweet. I have quite a few files with really really old bmt info in them that the name of the actual metadata title is the unc path and file name. Will this tool fix that?
I'm not sure... you can run the tool on a directory or a single file, so it would be easy to test it out. Also if you post a filename, I'm can probably pretty quickly tell you if it will work.

I've had pretty good success with it, and I believe @mkanet has had some good results as well, since he was my primary tester and he uncovered lots of little nuances.
Reply With Quote
  #5  
Old 02-14-2012, 12:54 PM
mkanet's Avatar
mkanet mkanet is offline
SageTVaholic
 
Join Date: Feb 2004
Posts: 3,359
Thumbs up

Stuckless is being very modest in releasing this utility. Very few people realize that this utility is the "smartest" light-weight media file renamer in existence... with or without sageTV.

Pretty much all standalone renamers out there are not smart enough to actually tell the difference between a movie and TV show. A few weeks back I was looking for a media file renamer; and, quickly found out that I actually have to put each media file in a TV show or Movies folder, or they wont know what to do with them. It's good to know we now have the power of the sageTV phoenix media identification engine outside of sageTV. Thanks Stuckless! I use the phoenix renamer in conjunction with my powerful directory monitoring tool... "WatchDirectory". No scripting knowledge necessary... Just a basic batch file to kick off when a media file is saved in a folder.
__________________
Upgraded to Comcast X1 + Netflix/Amazon Video streaming

***RIP SageTV***

Last edited by mkanet; 02-14-2012 at 04:20 PM.
Reply With Quote
  #6  
Old 02-14-2012, 01:10 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Quote:
Originally Posted by stuckless View Post
I'm not sure... you can run the tool on a directory or a single file, so it would be easy to test it out. Also if you post a filename, I'm can probably pretty quickly tell you if it will work.

I've had pretty good success with it, and I believe @mkanet has had some good results as well, since he was my primary tester and he uncovered lots of little nuances.
I think I may have misunderstood the purpose of this tool. It doesn't actually gather metadata, it just renames the file/folder with what the title BMT comes up with. Right?
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA
Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60
Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u
Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup.
Reply With Quote
  #7  
Old 02-14-2012, 03:06 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Quote:
Originally Posted by panteragstk View Post
I think I may have misunderstood the purpose of this tool. It doesn't actually gather metadata, it just renames the file/folder with what the title BMT comes up with. Right?
It does use BMT's metadata engine (ie, Phoenix) to do the lookups, but it's actually a little smarter than Phoenix in that it will look at the filename and find a match, and if no match is found, then it will also look at the folder name and attempt a match on it. It does the metadata lookup so that it knows the correct title for renaming. If it can't find a metadata hit, then it will no rename anything.

For example, if your movie is called
c:\media\Salt\movie.mkv
then Phoenix/BMT will fail, but the this rename will still find the correct hit by looking at the folder name as well.

Hope that clarifies things.
Reply With Quote
  #8  
Old 02-14-2012, 03:58 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
Just curious, but does it use the existing MediaTitles.xml, or something similar?
Reply With Quote
  #9  
Old 02-14-2012, 04:10 PM
mkanet's Avatar
mkanet mkanet is offline
SageTVaholic
 
Join Date: Feb 2004
Posts: 3,359
It doesnt need anything except for an Internet connection to rename any media file. This would work for people who dont even have sageTV installed; although, it knows to rename .properties files, subtitle files, etc in a folder.

Quote:
Originally Posted by Dargason View Post
Just curious, but does it use the existing MediaTitles.xml, or something similar?
__________________
Upgraded to Comcast X1 + Netflix/Amazon Video streaming

***RIP SageTV***
Reply With Quote
  #10  
Old 02-14-2012, 08:12 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Quote:
Originally Posted by Dargason View Post
Just curious, but does it use the existing MediaTitles.xml, or something similar?
When you first run the tool it will create a PhoenixHome directory in the .exe directory. In there will be a sagetv/ folder and you can copy your MediaTitles.xml from your sagetv installation into the corresponding area under the sagetv directory.

This tool is basically a stand-alone version of Phoenix so it has it's own configuration areas outside of the normal phoenix area.
Reply With Quote
  #11  
Old 02-14-2012, 09:27 PM
wrems's Avatar
wrems wrems is offline
Sage Icon
 
Join Date: Feb 2007
Location: Marietta, GA
Posts: 1,332
Nice work! I'll be checking this out most definitely.
Reply With Quote
  #12  
Old 02-15-2012, 07:38 PM
jusjoken jusjoken is offline
Sage Icon
 
Join Date: Dec 2005
Location: Minneapolis MN
Posts: 2,110
Great work... again!

It looks like this will be my new renamer tool. So far it renamed everything I have thrown at it... and correctly

Question - is there any way to adjust the output name format? I am a little picky about the output but it's not a huge issue... just thought I might be able to change an XML configuration file somewhere to make...

Two and a Half Men - S09E16 - Sips, Sonnets and Sodomy.avi

Look like...

Two and a Half Men S09E16 Sips, Sonnets and Sodomy.avi

k
Reply With Quote
  #13  
Old 02-15-2012, 08:10 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Quote:
Originally Posted by jusjoken View Post
Great work... again!

It looks like this will be my new renamer tool. So far it renamed everything I have thrown at it... and correctly

Question - is there any way to adjust the output name format? I am a little picky about the output but it's not a huge issue... just thought I might be able to change an XML configuration file somewhere to make...

Two and a Half Men - S09E16 - Sips, Sonnets and Sodomy.avi

Look like...

Two and a Half Men S09E16 Sips, Sonnets and Sodomy.avi

k
The first round, I didn't add support for changing the output file format. I'll look at adding support for that in future releases.
Reply With Quote
  #14  
Old 02-16-2012, 03:19 PM
jusjoken jusjoken is offline
Sage Icon
 
Join Date: Dec 2005
Location: Minneapolis MN
Posts: 2,110
For Windows uses like myself... tip:

Create a desktop shortcut of the "phoenix-renamer.exe" file (right click it and pick Send To - Desktop (create shortcut)).

Then just drag and drop 1 or more files to be renamed onto the shortcut... and the magic begins!!!! Quick and easy way to do renaming.

k
Reply With Quote
  #15  
Old 02-18-2012, 10:54 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Phoenix Renamer 1.0.2

I've updated a new build. This build includes the following

- Bug fixes (issue when renaming files that were already renamed)
- Better support for TVDB for files that have "and" instead of "&"
- Added support to use a custom tv or movie mask so that you customize the renamed file (ie, some people didn't want the default 'Title - S##E## - Episode', so you can use your own mask from the keywords, MediaTitle, EpisodeName, SeasonNumber, EpisodeNumber, and Year)
Reply With Quote
  #16  
Old 02-18-2012, 01:50 PM
jusjoken jusjoken is offline
Sage Icon
 
Join Date: Dec 2005
Location: Minneapolis MN
Posts: 2,110
Thanks for the fixes/enhancements.

Each of the fixes work as expected and the enhancement for the control on the masks is a great feature.

k
Reply With Quote
  #17  
Old 02-18-2012, 02:10 PM
mkanet's Avatar
mkanet mkanet is offline
SageTVaholic
 
Join Date: Feb 2004
Posts: 3,359
Thanks!!!

Quote:
Originally Posted by stuckless View Post
I've updated a new build. This build includes the following

- Bug fixes (issue when renaming files that were already renamed)
- Better support for TVDB for files that have "and" instead of "&"
- Added support to use a custom tv or movie mask so that you customize the renamed file (ie, some people didn't want the default 'Title - S##E## - Episode', so you can use your own mask from the keywords, MediaTitle, EpisodeName, SeasonNumber, EpisodeNumber, and Year)
__________________
Upgraded to Comcast X1 + Netflix/Amazon Video streaming

***RIP SageTV***
Reply With Quote
  #18  
Old 02-18-2012, 03:05 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,506
Quote:
Originally Posted by jusjoken View Post
Thanks for the fixes/enhancements.

Each of the fixes work as expected and the enhancement for the control on the masks is a great feature.

k
I haven't tested this, but you may be able to specify the mask in the standalone.properties as well...

Code:
phoenix/renamer/tvMask=YOUR MASK
phoenix/renamer/movieMask=YOUR MASK
standalone.properties is in the PhoenixHome which is in the same location as the .exe file.
Reply With Quote
  #19  
Old 02-18-2012, 03:31 PM
jorton jorton is offline
Sage Icon
 
Join Date: Jul 2005
Location: Canada
Posts: 1,273
Thanks Stuckless!

This is a great utility.

Reply With Quote
  #20  
Old 02-18-2012, 08:13 PM
jusjoken jusjoken is offline
Sage Icon
 
Join Date: Dec 2005
Location: Minneapolis MN
Posts: 2,110
Quote:
Originally Posted by stuckless View Post
I haven't tested this, but you may be able to specify the mask in the standalone.properties as well...

Code:
phoenix/renamer/tvMask=YOUR MASK
phoenix/renamer/movieMask=YOUR MASK
standalone.properties is in the PhoenixHome which is in the same location as the .exe file.
I just tested this and it does work for setting the Masks in the standalone.properties file.

Excellent.

k
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Phoenix Error after deleting Phoenix UI wayner Phoenix 9 01-03-2012 11:08 PM
Is this possible in Phoenix? Kirby Phoenix 0 10-22-2011 10:20 AM
Phoenix Source (and how to rebuild Phoenix from sources) stuckless Phoenix 2 09-22-2011 10:26 PM
Phoenix API stuckless SageTV Customizations 264 03-17-2011 11:36 AM


All times are GMT -6. The time now is 10:00 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.