SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1261  
Old 08-27-2011, 12:56 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
How did you move the archives? Are you moving them to an import folder if you just move them..... did you do a refresh? If moving them to an import folder all you have to do is a refresh..... if moving them to another folder other than an import or recording directory you have to relink them if you want to see them in recordings.
__________________
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; 08-27-2011 at 12:58 PM.
Reply With Quote
  #1262  
Old 08-27-2011, 01:29 PM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
I manually moved them to an import folder (from my recording drive to my "archive" drive)

What exactly do you mean by "refresh"? They do show up in my Video Library section, and I can play them fine, I just don't see any of the show information. And what's entailed with "relinking"? Sorry - that sounds like a noob-kind of question.
Reply With Quote
  #1263  
Old 08-27-2011, 01:48 PM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
I went to the Web GUI and selected to rescan - we'll see what happens.

I'm also re-visiting /BMT page - pretty cool - but not sure if that provides a solution or not.

So, in the scanning process, does it find media files, and if a .my file is found, read it and import that into Sage's database so that it shows in the Sage (SageMC) client?
Reply With Quote
  #1264  
Old 08-28-2011, 07:51 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
The "library import scan" finished and I now have mixed results. Some Shows directories have the information, others - or at least my "example" directory, AmericasGotTalent shows the *number* of shows correctly (22), but when I navigate to the folder (showing 22 items), there is only one media file.

How do I "relink" a certain folder?
Reply With Quote
  #1265  
Old 08-28-2011, 08:08 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Quote:
Originally Posted by nyplayer View Post
Here is a Simple one to Move Archives.... I copy the file first and make sure it is completely copied before doing a re-link..... which deletes the original.


Code:
//Relink TVShows
if [IsObjMediaFile == true && $.IsFileCurrentlyRecording{} == "false" && Filename =$ ".mpg" && FileExists == "%d%/%p%.relink" && FileExists == "C://_TVShows/$.GetShowTitle{}/%p%.mpg" && $.GetNumberOfSegments{} == "1"] {
   :PRIORITY 1500
   :RELINKOPTS "$.GetAiringID{}" "C://_TVShows/$.GetShowTitle{}/%p%.mpg"
   _RELINK
}
I'm learning so much from you...

In the Relink, you have:
"C://_TVShows/$.GetShowTitle{}/%p%.mpg"
why is only the first directory delimeter "//", the others are single, "/". I thought I understood I can either:
"C:\\_TVShows\\$.GetShowTitle{}\\%p%.mpg"
or:
"C:/_TVShows/$.GetShowTitle{}/%p%.mpg"

ASIDE:
Did you customize this for me using my "_TVShows" or is this a case of "great minds think alike"?

Last edited by BKeadle; 08-28-2011 at 08:12 AM.
Reply With Quote
  #1266  
Old 08-28-2011, 12:01 PM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Very interesting script. I see your command:
Code:
move "%~f1" "%~dp1"
set checkuse=%ERRORLEVEL%
if %checkuse% NEQ 0 exit 1
(I changed %~d1%~p1 to a shortened version, %~dp1)
is trying to move a file to itself. This actually works as a test for a file being in use? Very cool if so.

Code:
set outdir=%3
for /f "useback tokens=*" %%a in ('%outdir%') do set outdir=%%~a

set MediaTitle=%2
for /f "useback tokens=*" %%a in ('%MediaTitle%') do set MediaTitle=%%~a
Nice trick for dealing with quoted parameters!

It's a good day when we learn something new!

Assuming the video being moved is on the same volume, wouldn't it be better to just move it instead of xcopy? Is there a reason you're copying instead of moving?

Last edited by BKeadle; 08-28-2011 at 12:06 PM.
Reply With Quote
  #1267  
Old 08-28-2011, 12:27 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
I use xcopy instead of move because in my case the destination folder is not in SageTV... It is neither an Import or a recording directory in SageTV. SJQ needs to see the original file in order to do a relink. If your destination folder is a Sagetv import then you can use a move.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #1268  
Old 08-28-2011, 12:43 PM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Quote:
Originally Posted by BKeadle View Post
The "library import scan" finished and I now have mixed results. Some Shows directories have the information, others - or at least my "example" directory, AmericasGotTalent shows the *number* of shows correctly (22), but when I navigate to the folder (showing 22 items), there is only one media file.

How do I "relink" a certain folder?
Care to comment on this, nyplayer?
Reply With Quote
  #1269  
Old 08-28-2011, 12:54 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
What I would do is move a few back to a recording folder to see if it finds the info from the guide... that is if you did not rename them. Just move a few and do a video refresh.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #1270  
Old 08-28-2011, 03:55 PM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Now I'm really confused...

1) After having moved only a few of the shows back to the Recordings folder, *All* the recordings (for America's Got Talent) is back in the TV Recordings page, with many of them with Archive enabled and all the show information is intact. Are the ones showing as "Archived" by virtue of them being in an Import folder, not the recording folder?

Is there a way to show the full filename of the show in the Sage Client (like I can see in the Sage Web interface?)


I also realized - working on your SJQMoveTitle script - that the filename AmericasGotTalent-* does *not* indicate the show title; the show title is "America's Got Talent". So my current directory structure is "invalid", and I need to change all the directories to reference the *Show Title*, not the filename prefix:
Code:
.\AmericasGotTalent\AmericasGotTalent*.mp4
to
Code:
.\America's Got Talent\AmericasGotTalent*.mp4
2) I'm trying to also run a _RELINK. Here's my Server Ruleset:
Code:
if [IsObjMediaFile == true && $.IsFileCurrentlyRecording{} == "false" && Filename =* "_TVShows" && Filename =* "AmericasGotTalent-" && $.GetNumberOfSegments{} == "1"] 
{
   :PRIORITY 1500
   :RELINKOPTS "$.GetAiringID{}" "V:\\Videos\Drobo2\\Recordings\\_TVShows\\$.GetShowTitle{}\\%p%.mpg"
   _RELINK
}
The task fails with this error:
Code:
java.lang.IllegalArgumentException: File argument must exist and be readable!
And the MediaDebugger shows this:
Code:
2011-08-28 16:50:43,980 WARN  [MediaFileQueueLoader]: Processing 'America's Got Talent'...
2011-08-28 16:50:43,980 WARN  [RulesParser]: 	Line 5: Evaluating 'IsObjMediaFile == "true"' == true
2011-08-28 16:50:43,980 WARN  [RulesParser]: 	Line 5: Evaluating '$.IsFileCurrentlyRecording{} == "false"' == true
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%c%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent\AmericasGotTalent-1390208-0.mpg'
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%d%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent'
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%f%' == 'AmericasGotTalent-1390208-0.mpg'
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%e%' == 'mpg'
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%p%' == 'AmericasGotTalent-1390208-0'
2011-08-28 16:50:43,980 WARN  [RulesParser]: 	Line 5: Evaluating 'Filename =* "_TVShows"' == true
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%c%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent\AmericasGotTalent-1390208-0.mpg'
2011-08-28 16:50:43,980 WARN  [MediaVariables]: 	MediaVar '%d%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent'
2011-08-28 16:50:43,996 WARN  [MediaVariables]: 	MediaVar '%f%' == 'AmericasGotTalent-1390208-0.mpg'
2011-08-28 16:50:43,996 WARN  [MediaVariables]: 	MediaVar '%e%' == 'mpg'
2011-08-28 16:50:43,996 WARN  [MediaVariables]: 	MediaVar '%p%' == 'AmericasGotTalent-1390208-0'
2011-08-28 16:50:43,996 WARN  [RulesParser]: 	Line 5: Evaluating 'Filename =* "AmericasGotTalent-"' == true
2011-08-28 16:50:43,996 WARN  [RulesParser]: 	Line 5: Evaluating '$.GetNumberOfSegments{} == "1"' == true
2011-08-28 16:50:43,996 INFO  [MediaFileQueueLoader]: Run completed [16ms]
2
So why should the task fail?
Reply With Quote
  #1271  
Old 08-29-2011, 06:07 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
In the Ruleset editor, what's the "Reload" button for? If I "Save" my ruleset, is it not active until I hit "Reload"?

Last edited by BKeadle; 08-29-2011 at 06:34 AM.
Reply With Quote
  #1272  
Old 08-30-2011, 05:04 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Reload puts back into the editor what you last saved.

Say you make a bunch of changes and realize you goofed BEFORE hitting SAVE.
You hit RELOAD and you are back (in the editor) where you began.
Reply With Quote
  #1273  
Old 08-31-2011, 08:21 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Ah - good to know. Thanks.
Reply With Quote
  #1274  
Old 09-01-2011, 04:40 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
I must have a syntax problem here, but can't figure it out. My ruleset is trying to filter against filenames. Here's the Media Debugger output.
Code:
2011-09-01 05:38:14,972 WARN  [RulesParser]: 	Line 61: Evaluating 'Filename =$ ".mpg"' == true
2011-09-01 05:38:14,972 WARN  [MediaVariables]: 	MediaVar '%c%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent\AmericasGotTalent-1390208-0.mpg'
2011-09-01 05:38:14,972 WARN  [MediaVariables]: 	MediaVar '%d%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent'
2011-09-01 05:38:14,972 WARN  [MediaVariables]: 	MediaVar '%f%' == 'AmericasGotTalent-1390208-0.mpg'
2011-09-01 05:38:14,972 WARN  [MediaVariables]: 	MediaVar '%e%' == 'mpg'
2011-09-01 05:38:14,972 WARN  [MediaVariables]: 	MediaVar '%p%' == 'AmericasGotTalent-1390208-0'
2011-09-01 05:38:14,972 WARN  [RulesParser]: 	Line 61: Evaluating 'Filename =* "(Fringe|AmericasGotTalent)"' == false
2011-09-01 05:38:14,972 WARN  [RulesParser]: 	Line 66: Evaluating 'IsObjMediaFile == "true"' == true
What gives?
Reply With Quote
  #1275  
Old 09-01-2011, 08:51 PM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Since I couldn't get this to resolve to true with media file:
V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent\AmericasGotTalent-1390208-0.mpg

Code:
MediaVar '%c%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent\AmericasGotTalent-1390208-0.mpg'
[MediaVariables]: 	MediaVar '%d%' == 'V:\Videos\Drobo2\Recordings\_TVShows\America's Got Talent'
[MediaVariables]: 	MediaVar '%f%' == 'AmericasGotTalent-1390208-0.mpg'
[MediaVariables]: 	MediaVar '%e%' == 'mpg'
[MediaVariables]: 	MediaVar '%p%' == 'AmericasGotTalent-1390208-0'
[RulesParser]: 	Line 61: Evaluating 'Filename =* "Fringe|AmericasGotTalent)"' == false
I did get this to resolve to True:
Code:
Filename =% ".*Fringe.*|.*AmericasGotTalent.*"
I suppose I could work with that, but I'd like to understand why Filename =* "Fringe|AmericasGotTalent" doesn't work. Isn't this expression saying, "if the filename contains the string Fringe or AmericasGotTalent "?

...TIME PASSES...

Well, OK, I suppose this will suffice:
(Filename =* "Fringe-" || Filename =* "AmericasGotTalent-")

Last edited by BKeadle; 09-01-2011 at 08:57 PM.
Reply With Quote
  #1276  
Old 09-02-2011, 05:15 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Quote:
Originally Posted by nyplayer View Post
Code:
//Relink TVShows
if [IsObjMediaFile == true && $.IsFileCurrentlyRecording{} == "false" && Filename =$ ".mpg" && FileExists == "%d%/%p%.relink" && FileExists == "C://_TVShows/$.GetShowTitle{}/%p%.mpg" && $.GetNumberOfSegments{} == "1"] {
   :PRIORITY 1500
   :RELINKOPTS "$.GetAiringID{}" "C://_TVShows/$.GetShowTitle{}/%p%.mpg"
   _RELINK
}
SJQMOVETITLE.bat
Code:
...
if %checkxcopy% EQU 0 echo "xcopy complete" >> "%~d1%~p1%~n1.relink"
if not exist "%~d1%~p1%~n1.relink" exit 1
exit 0
I see you're creating a *.relink "flag" file for the relink function. How does the .relink file ever go away? Does the internal _RELINK function know to delete the file? Does _RELINK rely on the existence of a .relink file?
Reply With Quote
  #1277  
Old 09-02-2011, 01:45 PM
doncote0's Avatar
doncote0 doncote0 is offline
Sage Aficionado
 
Join Date: Jun 2004
Location: Seattle, WA
Posts: 396
Lightbulb Perl Logical Operators For Strings and Numbers

Quote:
Originally Posted by BKeadle View Post
Well, OK, I suppose this will suffice:
(Filename =* "Fringe-" || Filename =* "AmericasGotTalent-")
According to the Perl logical operator explanation, || is for numbers and OR is for strings. You are comparing a string so you might want to use OR (same number of keystrokes).

It shouldn't matter though.

I wonder if (Filename =* ("Fringe-" || "AmericasGotTalent-")) would work.

Last edited by doncote0; 09-02-2011 at 01:54 PM.
Reply With Quote
  #1278  
Old 09-02-2011, 03:26 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by BKeadle View Post
I see you're creating a *.relink "flag" file for the relink function. How does the .relink file ever go away? Does the internal _RELINK function know to delete the file? Does _RELINK rely on the existence of a .relink file?
You simply use the SJQ built in file cleaning option. No relink does not rely on the relink file ..... I create the relink file in order to only relink if the copy completes with a zero condition code... you do not want to relink a partially copied file!!!!!!. That is why this is coded if %checkxcopy% EQU 0 echo "xcopy complete" >> "%~d1%~p1%~n1.relink"
__________________
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; 09-02-2011 at 03:33 PM.
Reply With Quote
  #1279  
Old 09-03-2011, 08:54 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Ah, I see. Clever. Thanks.
Reply With Quote
  #1280  
Old 09-03-2011, 08:56 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Quote:
Originally Posted by doncote0 View Post
According to the Perl logical operator explanation, || is for numbers and OR is for strings. You are comparing a string so you might want to use OR (same number of keystrokes).

It shouldn't matter though.

I wonder if (Filename =* ("Fringe-" || "AmericasGotTalent-")) would work.
In the examples in this thread that I used to come up with the syntax, I haven't seen the use of "OR" - but interesting to note the perl operator explanation. As for your suggestion, I'll give that a try for learning sake - what I have is working.

Thanks for your reply.
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
Sage Job Queue (SJQ) new release notifications Slugger Customization Announcements 3 12-17-2009 09:59 AM
Plugin: Sage Job Queue (SJQ) Slugger SageTV Customizations 991 12-11-2009 03:52 PM
Sage Job Queue Completed tasks problem raffmanlt SageTV Customizations 2 08-18-2009 07:34 PM
Comskip Monitor VS Sage Job Queue SJQ personalt SageTV Customizations 6 03-02-2009 10:27 AM
Plugin: SJQ v1.1.0RC1 Available - Testers Needed Slugger SageTV Customizations 35 04-21-2008 08:12 AM


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


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