|
General Discussion General discussion about SageTV and related companies, products, and technologies. |
|
Thread Tools | Search this Thread | Display Modes |
#61
|
||||
|
||||
yeah...im having issues with the python, cause well i don't know python very well.
I am struggling through it, and getting there...slowly :-) I hope to have something soon for peeps to test. |
#62
|
|||
|
|||
Quote:
What show do you have recorded that has S&E numbers,...I will record it as well and see if I get different filenames. |
#63
|
|||
|
|||
Adding S&E numbers is an option that came along with SageV7 - look in detailed setup. It is likely also pretty easy to write an SJQ script to change the filename to add this info to make it more Plex-compliant.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#64
|
||||
|
||||
Are you talking about renaming the old recordings to include SxxExx and updating the filename information in the sage database? That'd be great.
__________________
Intel Core i5-2500, 16GB RAM, OMV Linux 4.17, 3 TB of Data SageTV 9 Docker, Open DCT Docker Silicondust HDHomeRun Duo + Quatro Sage Mini Client on Amazon Fire Sticks and Android TVs |
#65
|
|||
|
|||
Yes - I am talking about renaming. I don't have too much experience at writing SJQ scripts but I have done a few. And I am pretty sure that the Sage API now contains the S&E info. Therefore you should be able to add it to the filenames pretty easily, assuming that this info is stored with the metadata from the original EPG entry or it was or can be retrieved by BMT.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#66
|
||||
|
||||
Quote:
:-) reading your post again i think i do understand...sorry so yes thats possible to do, but from what Sean told me one would have to 1 remove file from sage 2 rename file to appropriate format 3 reimport file as recording... what happens then with files like Americas Funniest Home Videos? these NEVER get sxxexx in my experience...i suppose sjq could pick those up and rename based on metadata from bmt... Writting a Plex media agent still seems cleaner to me, but im all for other options. Im not so good an python and running into issues with it :-/ Last edited by PiX64; 12-14-2011 at 04:58 PM. |
#67
|
||||
|
||||
Not sure if you all know this or not, but i found something in my testing that will actual add your sage recordings that aren't named right to your plex library
follow these steps: 1) from plex media manager select Home 2_ select MOVIES..yes movies 3) change the name at the top from movies to Sage Recordings or whatever you desire 4) hit advnaced tab 5) change the media scanner to plex video file scanner 6) change primary metadata agent to Personal Media thats it.. your sage files with their silly filenames will show up in plex. |
#68
|
||||
|
||||
* Maybe slugger can chime in here on how to set that up in SJQ...is SJQ free btw or do you have to pay for it?
|
#69
|
|||
|
|||
Quote:
I am also running this script to copy my sage files to another location in the proper format for Plex to grab metadata for them (as an interim solution - evaluation Plex/XBMC). It seems to get information from Sage's properties files if they exist. http://forum.xbmc.org/showthread.php?t=87261 |
#70
|
||||
|
||||
Quote:
That script will only work on Windows 7 as mklink command isn't supported in xp. |
#71
|
|||
|
|||
No, sorry, I am not using the symbolic link option. I am copying files to another shared drive. I am running Windows 2003 Server and I don't think it supports symbolic links either.
Thinking about setting up a Windows7 box to at least test WMC. Could try to test a Sage install on it also using a tuner from my HDhomerun. Got a few of them (unused machines) lying around prior to moving to Sage Extenders |
#72
|
||||
|
||||
Quote:
|
#73
|
|||
|
|||
Quote:
The instructions indicate the symlink option is optional. I suspect if this worked I wouldn't need to also copy the mpg file to the destination location. I did modify the config.xml only where it was required...ie: source and destination locations, filenames/shows to process, delete source or not option, tvdb login and key. I think that was it, everything else is at default. I set up an AT job to run this daily. So it is doing what it should...copying the mpg files to a directory structure that Plex/XBMC can read in. However, in the log file I do see it trying to create symlinks and failing....my assumption as I scan the huge log file (I have debugging turned up) is that it was just for internal tracking of the process...but I am probably incorrect. |
#74
|
||||
|
||||
Quote:
Ah ok.. no worries man i was just trying to understand what you were doing. I dont' want to spend anymore of my time creating a metadata agent for plex if it is really not necessary. I knew you could tell it to copy the file to a new location, but i didn't think it was possible to not create the symlinks. I think that if we can get some input from Slugger on the SJQ and if it is possible to set it up in such a way that it will scan the recordings directory, rename files, then reimport those files to sage, that would certainly be ideal. I spent some time trying to get Plex to be able to read the symlinks, but was 100% unsuccessful. If someone else has been able to figure this out, then i def think that is the quickest solution for all of us that are going to use plex in conjuction with our sage recordings. |
#75
|
|||
|
|||
Quote:
I kind of like your process of reading the SageTV DB and populating that metadata over to Plex. I have gone through and done a lot of fixing of metadata over the years. I might lose some of that if I just had Plex find its own metadata. It would also be nice if you could copy over Fanart files to Plex - I have created some custom Fanart where it did not exist. This is primarily for Sports and Kids' shows. TVDB does not allow you to upload Fanart for Sports shows. But if you have the S and E numbers in the filename then it should be pretty easy for Plex to automatically generate the metadata. The Sage API does in fact contain the Season and Episode in the API. Here are the entries: Code:
GetShowSeasonNumber public int GetShowSeasonNumber(sage.Show Show) Returns the season number of the specified Show. For episodic content; sometimes a numeric value is given to the season. If that information exists, this will return it. Parameters:Show - the Show object Returns:the season number of the specified Show, 0 if it is not set Since:7.1 -------------------------------------------------------------------------------- GetShowEpisodeNumber public int GetShowEpisodeNumber(sage.Show Show) Returns the episode number of the specified Show. For episodic content; sometimes a numeric value is given to the episode in a season. If that information exists, this will return it. Parameters:Show - the Show object Returns:the episode number of the specified Show, 0 if it is not set Since:7.1 Code:
Object mf = MediaFileAPI.GetMediaFileForID(Integer.parseInt(SJQ4_METADATA.get("SJQ4_ID"))); String OrigFileName = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT"); Int SeasonNum=ShowAPI.GetShowSeasonNumber(mf); Int EpNum=ShowAPI.GetShowEpisode(mf); ModernFamily-AftertheFire-6179364-0.mpg to ModernFamily-S03E08-AftertheFire-6179364-0.mpg So you would just parse the string for the first "-" and insert "S"+SeasonNum+"E"+EpNum - but you may have to force leading zeros to always have a two digit Series and Episode Number. Then just run a rename command passing the original and new file names. The problem may be if you have shows that were required by Sage v7.0 or earlier since it seems that the S&E info wasn't stored back then. Therefore you may have to have BMT fetch this data. But Slugger would be the expert at all of this.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#76
|
|||
|
|||
Are there any limitations on this - for example, some programs will only playback content that existed when you first started watching a show. So if you start watching a 60 min show 15 minutes into the show then you will only get the first 15 minutes. But if you restart watching you should get the rest.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#77
|
|||
|
|||
Quote:
Quote:
However... If you just want to write a script and run it once to scan your existing recordings then ignore SJQ and just write a Groovy script and import the sagex-api.jar as your means to access the Sage server. If you want it to continuously update your library on new recording events, etc. then you probably want the entire SJQ package. Warning: Yes, renaming your recordings in wiz.bin is very doable with SJQ/Groovy/any language, but it is not a simple process and one should be very cautious when writing such a script. I'd be testing it diligently before actually running it against my entire recording library. You need to rename the current recording file to the new desired file name, delete the entry from wiz.bin, import the new file name back into wiz.bin, then relink the new import to the old airing object for proper metadata. You need to check for and properly react to errors on any of those actions along the way (i.e. be able to completely roll back to where you started should any of those actions fail along the way). I have a script that moves files in my svn repository. It doesn't rename them, but I think someone modded it to do a rename based on S/E info - check the SJQv4 thread. Either way, this is an operation you want to test heavily before running against one's entire recording library. Good luck and happy scripting!
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#78
|
|||
|
|||
I did a rename of my files a while back in SJQ3. I did not like the way Sage named the files.
If it didn't have episodes then BMT fetched them. As long as you keep the airing ID at the end you simply do a rename inplace and a library refresh and all is fine. No need to touch the wiz.bin let Sage update the file name. Below is a sample of the final product. Criminal Minds - S06E07 - Middle Man-440210-0.mpg Code:
//Rule SJQRenameMYSeries if [IsObjMediaFile == "true" && $.IsTVFile{} == "true" && Filename =$ ".mpg" && Filename !* "- S0" && Filename !* "- S1" && Filename !* "- S2" && Filename !* "- S3" && FileExists == "%c%.properties" && FileExists == "%d%/%p%.VPrj" && $.GetNumberOfSegments{} == "1"] { :SCANMEDIA "true" // :RUNQLOADER "true" :PRIORITY 9999 SJQRenameMYSeries } //Client SJQRenameMYSeries { :MAX 1 :RESOURCES 55 "C:\\SJQNEW\\SJQRenameMYSeriesNew.bat \"%c%\" \"$.GetShowTitle{}\" \"$.GetShowEpisode{}\" \"$.GetShowSeasonNumber{}\" \"$.GetShowEpisodeNumber{}\" \"$.GetAiringID{}\"" } SJQRenameMYSeriesNew.bat move "%~f1" "%~d1%~p1" set checkuse=%ERRORLEVEL% if %checkuse% NEQ 0 exit 1 set MediaTitle=%2 rem for /f "useback tokens=*" %%a in ('%MediaTitle%') do set MediaTitle=%%~a set MediaTitle=%MediaTitle:: = % set MediaTitle=%MediaTitle:? = % set MediaTitle=%MediaTitle::= % set MediaTitle=%MediaTitle:?= % set MediaTitle=%MediaTitle:& =& % for /f "useback tokens=*" %%a in ('%MediaTitle%') do set MediaTitle=%%~a set episodename=%3 set episodename=%episodename:: = % set episodename=%episodename:? = % set episodename=%episodename::= % set episodename=%episodename:?= % set episodename=%episodename:& =& % set episodename=%episodename::=-% for /f "useback tokens=*" %%a in ('%episodename%') do set episodename=%%~a set SeasonNumber=%4 for /f "useback tokens=*" %%a in ('%SeasonNumber%') do set SeasonNumber=%%~a set SeasonNumber=0%SeasonNumber% set SeasonNumber=%SeasonNumber:~-2% echo %SeasonNumber% set EpisodeNumber=%5 for /f "useback tokens=*" %%a in ('%EpisodeNumber%') do set EpisodeNumber=%%~a set EpisodeNumber=0%EpisodeNumber% if %EpisodeNumber% LEQ 99 set EpisodeNumber=%EpisodeNumber:~-2% if %EpisodeNumber% GTR 99 set EpisodeNumber=%EpisodeNumber:~-3% echo %EpisodeNumber% set airingid=%6 for /f "useback tokens=*" %%a in ('%airingid%') do set airingid=%%~a move /Y "%~f1" "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0%~x1" set checkmove=%ERRORLEVEL% if %checkmove% NEQ 0 exit 1 move /Y "%~f1.properties" "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0%~x1.properties" move /Y "%~d1%~p1%~n1.qfix" "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0.qfix" move /Y "%~d1%~p1%~n1.edl" "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0.edl" move /Y "%~d1%~p1%~n1.VPrj" "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0.VPrj" move /Y "%~d1%~p1%~n1.aspects" "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0.aspects" echo "renamed" >> "%~d1%~p1%MediaTitle% - S%SeasonNumber%E%EpisodeNumber% - %episodename%-%airingid%-0.renamed" if %checkmove% EQU 0 exit 0 Thia is the actual SJQ log Code:
Task Log: 673776/SJQRenameMYSeries Wed Dec 14 07:29:05 PST 2011: Starting task with priority 5/1/10 Executing command line: C:\SJQNEW\SJQRenameMYSeriesNew.bat "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.mpg" "Criminal Minds" "Middle Man" "6" "7" "440210" The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. C:\SJQService\sjqc_winntsvc\bin>move "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.mpg" "C:\Users\Administrator\Videos\SageTV\" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>set checkuse=0 C:\SJQService\sjqc_winntsvc\bin>if 0 NEQ 0 exit 1 C:\SJQService\sjqc_winntsvc\bin>set MediaTitle="Criminal Minds" C:\SJQService\sjqc_winntsvc\bin>rem for /f "useback tokens=*" %a in ('"Criminal Minds"') do set MediaTitle=%~a C:\SJQService\sjqc_winntsvc\bin>set MediaTitle="Criminal Minds" C:\SJQService\sjqc_winntsvc\bin>set MediaTitle="Criminal Minds" C:\SJQService\sjqc_winntsvc\bin>set MediaTitle="Criminal Minds" C:\SJQService\sjqc_winntsvc\bin>set MediaTitle="Criminal Minds" C:\SJQService\sjqc_winntsvc\bin>set MediaTitle="Criminal Minds" C:\SJQService\sjqc_winntsvc\bin>for /F "useback tokens=*" %a in ('"Criminal Minds"') do set MediaTitle=%~a C:\SJQService\sjqc_winntsvc\bin>set MediaTitle=Criminal Minds C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>set episodename="Middle Man" C:\SJQService\sjqc_winntsvc\bin>for /F "useback tokens=*" %a in ('"Middle Man"') do set episodename=%~a C:\SJQService\sjqc_winntsvc\bin>set episodename=Middle Man C:\SJQService\sjqc_winntsvc\bin>set SeasonNumber="6" C:\SJQService\sjqc_winntsvc\bin>for /F "useback tokens=*" %a in ('"6"') do set SeasonNumber=%~a C:\SJQService\sjqc_winntsvc\bin>set SeasonNumber=6 C:\SJQService\sjqc_winntsvc\bin>set SeasonNumber=06 C:\SJQService\sjqc_winntsvc\bin>set SeasonNumber=06 C:\SJQService\sjqc_winntsvc\bin>echo 06 06 C:\SJQService\sjqc_winntsvc\bin>set EpisodeNumber="7" C:\SJQService\sjqc_winntsvc\bin>for /F "useback tokens=*" %a in ('"7"') do set EpisodeNumber=%~a C:\SJQService\sjqc_winntsvc\bin>set EpisodeNumber=7 C:\SJQService\sjqc_winntsvc\bin>set EpisodeNumber=07 C:\SJQService\sjqc_winntsvc\bin>if 07 LEQ 99 set EpisodeNumber=07 C:\SJQService\sjqc_winntsvc\bin>if 07 GTR 99 set EpisodeNumber=07 C:\SJQService\sjqc_winntsvc\bin>echo 07 07 C:\SJQService\sjqc_winntsvc\bin>set airingid="440210" C:\SJQService\sjqc_winntsvc\bin>for /F "useback tokens=*" %a in ('"440210"') do set airingid=%~a C:\SJQService\sjqc_winntsvc\bin>set airingid=440210 C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.mpg" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.mpg" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>set checkmove=0 C:\SJQService\sjqc_winntsvc\bin>if 0 NEQ 0 exit 1 C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.mpg.properties" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.mpg.properties" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.qfix" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.qfix" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.edl" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.edl" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.VPrj" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.VPrj" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.aspects" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.aspects" 1 file(s) moved. C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.EDFAV" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.EDFAV" C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.JANFAV" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.JANFAV" C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.archive" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.archive" C:\SJQService\sjqc_winntsvc\bin>move /Y "C:\Users\Administrator\Videos\SageTV\CriminalMinds-MiddleMan-440210-0.OLDNOTWATCHED" "C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.OLDNOTWATCHED" C:\SJQService\sjqc_winntsvc\bin>echo "renamed" 1>>"C:\Users\Administrator\Videos\SageTV\Criminal Minds - S06E07 - Middle Man-440210-0.renamed" C:\SJQService\sjqc_winntsvc\bin>if 0 EQU 0 exit 0 Screen Cap attached of Sage Screen
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct. Last edited by nyplayer; 12-15-2011 at 08:58 AM. |
#79
|
||||
|
||||
Quote:
what happens though in the case that there is no season and episode number found in bmt? |
#80
|
|||
|
|||
Well if BMT does not find the season episode... and Sage does it will still work.. If neither has it then you can modify the the SJQ rule to only run if it sees season and episode. You can easily test this on just 1 recording rename it manually keeping the airingID at the end and do a refresh.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plex vs AirVideo for streaming files to iPad | wayner | General Discussion | 16 | 11-03-2011 12:13 PM |
Plex in a TV? What about sage? | rwc | General Discussion | 9 | 09-05-2010 04:38 PM |
Possible to get SageTV to handle my library more like Plex? | DAMAC | SageTV Mac Edition | 0 | 06-10-2009 10:33 AM |
Button press to bring Sage forward to front active? | IncredibleHat | SageTV Software | 8 | 05-30-2006 06:31 PM |
Anything new on the MVP front? | x[corwyn] | SageTV Customizations | 12 | 08-22-2004 06:49 AM |