SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 01-18-2011, 09:31 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by Slugger View Post
They will be marked as archived. Unfortunately, I don't know of any way to change this behaviour because the only way I can do the move and have it remain recognized as a recording is to move the file, delete the old media file object from wiz.bin and then trigger a core media directory scan. Sage then finds the file in its new location and updates the wiz.bin with the recording details. Unfortunately I have no guaranteed way to know what the media id is for the moved recording so as to restore flags. I could make a pretty good guess, but it wouldn't be perfect (under various conditions it would fail) and it's a crazy amount of complicated, error prone code to even try to make it happen. Therefore, moved recordings become archived recordings when moved. Maybe once the move script is out there for others to look at someone will come up with ideas on how to "fix" it.
Try this. Call GetMediaFileAiring to get the airing for the media file to be copied. Copy file to new location. Call AddMediaFile to add the copied file to the database (I use to do this with a NULL for the NamePrefix but that was probably a bad idea). Call DeleteFile to delete the original media and the database entry. Call SetMediaFileAiring to associate the airing to the copied media file. Call MoveTVFileOutOfLibrary to put recording back into normal recordings instead of archived. This needs refinement because in prior versions of SageTV (I think version 5 and early versions of 6) you could get duplicate media files in imported folders and recordings simultaneously. Also SageTV would occasionally delete the copied recording - I assumed SageTV thought it was a partial and deleted it - but don't know for sure. What worked for me was waiting between the steps above for a period of time - which probably means a race condition with the SageTV core operations. Obviously this would need extensive testing and backups of wiz.bin and the files being moved are mandatory if you want to hold on to the links to the files.

Last edited by BobPhoenix; 01-18-2011 at 09:35 PM.
Reply With Quote
  #22  
Old 01-18-2011, 09:41 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by BobPhoenix View Post
Try this. Call GetMediaFileAiring to get the airing for the media file to be copied. Copy file to new location. Call AddMediaFile to add the copied file to the database (I use to do this with a NULL for the NamePrefix but that was probably a bad idea). Call DeleteFile to delete the original media and the database entry. Call SetMediaFileAiring to associate the airing to the copied media file. Call MoveTVFileOutOfLibrary to put recording back into normal recordings instead of archived. This needs refinement because in prior versions of SageTV (I think version 5 and early versions of 6) you could get duplicate media files in imported folders and recordings simultaneously. Also SageTV would occasionally delete the copied recording - I assumed SageTV thought it was a partial and deleted it - but don't know for sure. What worked for me was waiting between the steps above for a period of time - which probably means a race condition with the SageTV core operations. Obviously this would need extensive testing and backups of wiz.bin and the files being moved are mandatory if you want to hold on to the links to the files.
I tried what you describe originally and all the problems you raise are exactly what I ran into. Only the move file, trigger media scan approach seems to work without issue (and it's the "Narflex recommended" way to do it) so I don't think I'll change the script I have in SVN (not that it should stop anyone wishing to experiment themselves).
__________________
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...
Reply With Quote
  #23  
Old 01-18-2011, 09:45 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by Slugger View Post
I tried what you describe originally and all the problems you raise are exactly what I ran into. Only the move file, trigger media scan approach seems to work without issue (and it's the "Narflex recommended" way to do it) so I don't think I'll change the script I have in SVN (not that it should stop anyone wishing to experiment themselves).
Don't blame you. That's one of the major reasons I never released an update to my VideoEdit plugin - that and coding myself into a corner - now just no time to think about rewriting it.
Reply With Quote
  #24  
Old 04-14-2011, 07:41 AM
gdippel gdippel is offline
Sage Aficionado
 
Join Date: Oct 2003
Location: Bayside, New York
Posts: 301
Quote:
Originally Posted by Slugger View Post
This is the script I use:

http://sagetv-addons.googlecode.com/...ia_file.groovy

And this is the script I schedule in cron to find the recordings I want to archive:

http://sagetv-addons.googlecode.com/...archive.groovy

There's two ways to go about this:

1) If you have favourites that you want to always move when they're done recording then it's dead simple: Create a task that executes the first script above and attach it to the favs you want to archive.

2) If you want to be a little more selective about what gets archived and when then use the second script and schedule it in cron to run periodically. It'll scan all your recordings and schedule the archive task (script 1) to run on the recordings it finds. I use this method to move things like all recorded movies (except documentaries), recordings that hit a certain age, certain syndicated programs, etc. You'll obviously need to tweak the script to your needs.
If I understand this, the "find_ tv_ to_ archive" groovy script will queue designated items to be processed with the "move_media_file" script. I've created a task to run the "find_ tv_ to_ archive" groovy script as an executable (no test script or arguments) and a task MVMEDIA to run "move_media_file" also as an executable (no test script or arguments).

When I queue the find_ "tv_ to_ archive" task, (I intend to run it via Cron when I get it working) it returns as completed, but with no log entries and no queued "move_media_file" tasks.

The only changes I made to the "find_ tv_ to_ archive" script is specifying my nas directory and tv shows to archive. Any suggestions?
Reply With Quote
  #25  
Old 04-14-2011, 08:30 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
You're going to have to add println statements at selected points in the script to determine why it's failing for recordings you expect it to queue MVMEDIA tasks for.

Even better, install SageGroovy IDE (or Eclipse, etc.) and run the find script in there. Eclipse is nicer because it has a debugger you can use to trace your code, but way more work to setup. But since Eclipse runs outside of Sage, the debugger isn't quite as useful and println statements are probably still going to be required. Either way, an IDE to run the script out of is much better than having to edit your script and queue it up to run in SJQv4 then go looking for the output, etc.

Also, please move this discussion to the SJQv4 thread as it's likely to help others (and I'll also get notifications of new posts to that thread whereas I'm likely to lose track of this thread should it get bumped down).
__________________
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...
Reply With Quote
  #26  
Old 04-14-2011, 12:43 PM
gdippel gdippel is offline
Sage Aficionado
 
Join Date: Oct 2003
Location: Bayside, New York
Posts: 301
Quote:
Originally Posted by gdippel View Post
If I understand this, the "find_ tv_ to_ archive" groovy script will queue designated items to be processed with the "move_media_file" script. I've created a task to run the "find_ tv_ to_ archive" groovy script as an executable (no test script or arguments) and a task MVMEDIA to run "move_media_file" also as an executable (no test script or arguments).

When I queue the find_ "tv_ to_ archive" task, (I intend to run it via Cron when I get it working) it returns as completed, but with no log entries and no queued "move_media_file" tasks.

The only changes I made to the "find_ tv_ to_ archive" script is specifying my nas directory and tv shows to archive. Any suggestions?
I found the problem. I should have checked the log file before posting. I mistyped the name of the groovy script (should have been "mv_media_file", not "move_media_file") when setting up the task. It's working fine now, queuing the tasks and archiving the files.
Reply With Quote
Reply


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

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
Newbie - Move recordings successful, but not all moved recordings recognized echang2 SageTV Software 2 05-13-2010 10:13 PM
SageTV Recordings move around in teh list MickBurke SageTV Software 2 03-10-2009 01:15 PM
Missing recordings in Service Mode after move to v6.5 pez SageTV Software 3 03-09-2009 11:00 PM
Trying to move recordings OverClock SageTV Software 2 03-02-2006 11:54 AM
How to move recorded shows into Archived Recordings? tmiranda SageTV Software 2 02-20-2006 12:00 PM


All times are GMT -6. The time now is 01:32 AM.


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