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
  #1  
Old 07-18-2006, 06:52 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Arrow STV Import: Anti-Favorites

This is a plugin which allows to define "Anti-Favorites" to exclude certain IR or Favorite shows from being recorded by marking them automatically as "Watched" or "DontLike".

Important: This utility is aimed towards the advanced user, and support in case of problems/questions will be very limited. In its current form, this plugin is more an "engine" which provides functionality for automatic marking of shows. The way to define the marking criterias is certainly cumbersome right now, it would need a nice GUI to to define the conditions in a simple way instead of using cryptic keywords. But I dont think I'll ever have the time for doing this, maybe someone else here will get interested. Nevertheless, the functionality works fine for me (and for a couple of others who already tested this plugin before), so if you think you could benefit from its features and are willing to master the learning curve, just give it a try.


How the plugin works:

The automatic "DontLike" / "Watched" marking is triggered by the presence of keyword favorites with special 'tags' at the beginning of the keyword, followed by the actual exclusion criteria. When you start SageTV, a background task is started which periodically (default every 60 minutes, but this can be changed with the property plugins/df/favorite_excluder/run_interval) scans your scheduled recordings. During each scan, it tries to match any of the defined exclusion favorites against any scheduled shows. If an exclusion favorite matches, it will either a) mark the show as "Watched", or b) mark the show as "DontLike", depending on the favorite definition. A few minutes later, Sage will remove this show from the recording schedule and the IR suggestion list


Definition of exclusion favorites which will only affect IR recordings:

Create a new keyword favorite, and use the following syntax (substitute 'xxx' with the exclusion criteria) :

To mark shows as "DontLike":

dl-keyword-xxx
dl-title-xxx
dl-category-xxxx
dl-actor-xxxx
dl-channel-xxxx
dl-time-HH:mm-HH:mm (e.g. dl-time-20:15-23:00)

To mark as 'Watched':

wd-keyword-xxxx
wd-title-xxxx
wd-category-xxxx
wd-actor-xxxx
wd-channel-xxxx
wd-time-HH:mm-HH:mm


Examples:

(1) if you want to teach IR that you do not want to have any computer related shows recorded, set up a favorite with keyword 'dl-category-computers'. Whenever Sage will suggest and schedule a show with this category, the plugin will mark the show as "DontLike" during the next scan, and Sage will finally remove it from the schedule.

(2) if you are interested in action movies, but don't care for the ones with Arnold, you could set up a favorite with keyword 'wd-actor-schwarzenegger' which will mark those movies as watched (and make Sage not record them)

(3) if you hate snakes, you can exclude all shows where "snake" appears in any of title/desctription/episode/actors by defining a favorite 'dl-keyword-snake'

Note:
- the tags and match criteria are not case-sensitive
- if you want to match a specific category/subcategory combination, specify 'category-subcategory' as xxx, e.g. 'talk-religious'
- when you create the favorite, select "Search All Fields" in the following dialog (if you are using the default STV)


Definition of exclusion favorites which will only affect existing regular favorites:

Even if you don't use IR, you can use the exclude mechanism to define 'NOT' conditions on your normal favorites, which is currently not possible in Sage. Note: each Anti-Favorite only applies to one specific regular favorite.

Use the same syntax as before, but apppend

1) keyword which specifies what kind of existing favorite

favk = keyword favorite
favt = title favorite
favc = category favorite

2) the exact keyword/title/category of the existing favorite

1) and 2) will basically tie the Anti-Favorite to a specific regular favorite, to which the exclusion criteria will apply

Examples:


(1) you have a regular keyword favorite for "texas tech basketball", but only want to have men's games recorded. You can now setup a favorite exclude with the keyword

Code:
     wd-keyword-women-favk-texas tech basketball
where

- 'wd-keyword-women' is the exclusion criteria as before
- 'favk' specifies that this should apply to a keyword favorite
- 'texas tech basketball' is the exact keyword of the standard favorite which you want to add the NOT condition to

This will mark all "texas tech basketball" shows which include the keyword "women" as 'Watched' so that Sage will remove it from the schedule shortly after.



(2) you have a regular category favorite for 'Western', but get annoyed that Sage is insisting of recording "Walker, Texas Ranger" all the time:

Code:
     dl-title-walker, texas ranger-favc-western
this will exclude "Walker, Texas Ranger" titles from your 'Western' category favorite by marking them as 'DontLike'

Note for keyword-title favorites:

If your existing favorite is a keyword favorite which is restricted to title, Sage generates a keyword "TITLE:xxx". To reference such a favorite, use

wd-criteria-favk-title:xxxx
dl-criteria-favk-title:xxxx


Installation:
  • unzip the installation file into SageTV directory (e.g. C:\Program Files\SageTV\SageTV). Make sure to preserve the directory structure. This will copy df_sageutils.jar and df_sageplugins.jar to JARs and favorite_excluder.xml to STVs\SageTV3
  • rename favorite_excluder.xml to favorite_excluder.stvi if you are using the default STV
  • restart SageTV to pick up the JAR files
  • import favorite_excluder.xml/stvi in Detailed Setup->Advanced->Import Custom STVi
  • (optionally) add the internal screen 'Exclude Log' via nielm's dynamic menus or SageMCs custom menus
  • add plugins/df/favorite_excluder/run_interval=XX (XX minutes) to your property file if you want to change the scan interval (default = every 60 minutes)
  • restart SageTV once more (the background scan is started when Sage starts up)

Configuration:


The following properties can be used to configure the plugin:
  • plugins/df/favorite_excluder/enabled=true (enable/disable scanning)
  • plugins/df/favorite_excluder/lookahead=72 (recording lookahead, in hours)
  • plugins/df/favorite_excluder/run_interval=60 (scan interval, in minutes)
The 'Exclude Log' screen shows the activity of the plugin. During each scan it will print out any actions ('Watched' / 'DontLike' markings) performed on matching shows. If you want to force a rescan before the time interval has elapsed you need to restart Sage. If you want to disable scanning altogether, set the property plugins/df/favorite_excluder/enabled to true, this setting will take effect after the next restart.

The plugin can be downloaded here.

Dirk

Last edited by dflachbart; 07-30-2006 at 07:52 PM.
Reply With Quote
  #2  
Old 07-18-2006, 08:39 PM
something fishy something fishy is offline
Sage Advanced User
 
Join Date: Sep 2004
Posts: 240
This looks awesome. It will allow me to set up Boolean ANDNOT operators yes?

I think that you are right this is for ‘power users’ and I don’t think needs to be menu driven. Its excellent to have this functionality in any form but as most people these days are pretty familiar with Boolean search strings, would it be possible to have the addin parse the whole favorite string. If so you could make this more intuitive by creating ANDNOT(K/T/C/A/CH): operators so that:

Code:
My favourite ANDNOT(T): excludeme
is 'my' AND 'search' in all fields except for programs with 'excludeme' in the title.
To achieve the same as creating 2 favourites:
Code:
Favourite1: My search
Favourite2: wd-title-excludeme-favk-my search
etc

For those you want to set up blanket watched flags
SETWATCHED(K/T/C/A/CH): could be made the same as
<space> ANDNOT(K/T/C/A/CH): excludeme
and would work and you could create
DONTLIKE(K):
DONTLIKE(T):
DONTLIKE(C):
DONTLIKE(A):
DONTLIKE(CH):
To mark shows with the don’t like flag.

Just suggestions; it’s fabulous as is.

Cheers
Reply With Quote
  #3  
Old 07-19-2006, 06:50 AM
JUC's Avatar
JUC JUC is offline
Sage Icon
 
Join Date: May 2004
Location: Vermont, USA
Posts: 1,399
Dirk, this looks great. I know alot of people have been asking for this and once again you come through with some great added functionality. I plan on trying this out tonight when I get home. I think the ability to exclude 'news' broadcasts is going to get me back into using the IR functionality of Sage. I like to watch the news--but not record every news channel (which is what IR will do).
Thanks!
JUC
__________________
Server: Athlon 2000XP; 1GB Kingston Ram; 250GB Seagate; 160GB Seagate; 160GB Western Digital; Lite-on DVD player; Hauppauge Rosyln; Hauppauge PVR-150; ATI AIW 7500; Actisys 200L; running stock v5 .stv


Client: MVP Extender running SageMC
Reply With Quote
  #4  
Old 07-19-2006, 10:45 AM
grooves12 grooves12 is offline
Sage Aficionado
 
Join Date: Feb 2006
Posts: 303
The biggest problem I have with setting up favorites is that when I set up a favorite to record all NEW episodes... ALL episodes start getting picked up by IR. Isn't that the point of selecting that option?? I DON'T want the old episodes recorded. Is there any way your plugin might be able to do something about that??
Reply With Quote
  #5  
Old 07-19-2006, 03:36 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Hi something fishy,

Quote:
Originally Posted by something fishy
This looks awesome. It will allow me to set up Boolean ANDNOT operators yes?
Yes, by defining an anti-favorite for a regular favorite you basically add a "AND NOT" condition. You can theoretically define multiple anti-favorites for a regular fav if you need multiple "AND NOT" criteria ...

Quote:
Originally Posted by something fishy
If so you could make this more intuitive by creating ANDNOT(K/T/C/A/CH): operators so that:

Code:
My favourite ANDNOT(T): excludeme
is 'my' AND 'search' in all fields except for programs with 'excludeme' in the title.
To achieve the same as creating 2 favourites:
Code:
Favourite1: My search
Favourite2: wd-title-excludeme-favk-my search
etc

For those you want to set up blanket watched flags
SETWATCHED(K/T/C/A/CH): could be made the same as
<space> ANDNOT(K/T/C/A/CH): excludeme
and would work and you could create
DONTLIKE(K):
DONTLIKE(T):
DONTLIKE(C):
DONTLIKE(A):
DONTLIKE(CH):
To mark shows with the don’t like flag.

Just suggestions; it’s fabulous as is.

Cheers
This is indeed a neat idea, but won't be possible. I am not changing the regular favorite processing of Sage in any way (is not possible with the current API), I am only post-processing after Sage has done its normal work. My anti-favorites are (on purpose) ignored by the Sage scheduler (because they will never match any show), so you will always need a regular favorite to begin with. There is no chance to do everything just with my "fake" anti-favorites ...

Dirk
Reply With Quote
  #6  
Old 07-19-2006, 04:05 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by grooves12
The biggest problem I have with setting up favorites is that when I set up a favorite to record all NEW episodes... ALL episodes start getting picked up by IR. Isn't that the point of selecting that option?? I DON'T want the old episodes recorded. Is there any way your plugin might be able to do something about that??
Mhh, are you sure you have "Firstruns Only" set in your regular favorite definition ? I just tried it here, and IR does not schedule any repeats of a firstrun-only show favorite for me ...

Dirk
Reply With Quote
  #7  
Old 07-19-2006, 04:16 PM
mayamaniac's Avatar
mayamaniac mayamaniac is offline
Sage Icon
 
Join Date: May 2004
Posts: 2,177
I will have to definitely try this later when I have time. Just from the info in the first post, this plugin can definitely give the user some control over what IR does. And if all goes well, I can turn IR back ON again. The only thing that still is a problem with IR is you can't tell it to ignore LiveTV. But this STVi definitely needs a GUI if its to be used by more than just power users.
__________________
Mayamaniac

- SageTV 7.1.9 Server. Win7 32bit in VMWare Fusion. HDHR (FiOS Coax). HDHR Prime 3 Tuners (FiOS Cable Card). Gemstone theme.
- SageTV HD300 - HDMI 1080p Samsung 75" LED.
Reply With Quote
  #8  
Old 07-19-2006, 04:53 PM
ekiwi ekiwi is offline
Sage User
 
Join Date: May 2004
Posts: 65
Love this import, great work.

thinking about it, there are two additional anti favorites I would use and they are based on start time

I am in a country dependant on XMLTV. The biggest problem I face is first/rerun doesn't work and because of this I end up recording things again and again.

for example

when the next season of NCIS starts it will be on in prime time. I don't know exactly which time slot yet or which channel. What i do know is if it is on in the afternoon it is a repeat. if it is on at anytime on the "Sky1" channel it is also a repeat

If I use your channel based anti favorite I can get rid of sky1 but other than making multiple favorites for 7pm 8pm 9pm 10pm 11pm i currently get the afternoon repeats

An AntiFavorite based on a time range 0100-1900 would leave me with only the prime time shows.

the other time based antifavorite i would find useful would be for channels like discovery and national geographic etc that repeat the same show 3 or 4 times within a 24 hour period.

because our xmltv data may have no episode name or a series based description, rather than an episode based description, i end up recording the same show 3 or 4 times in a day.

there are also shows that repeat for a week and then you get a new one.

to make this work you would need to specify when the cycle finishes

so only record one of a particular fav that airs between now and the next 6pm

or for the weekly version

only record one of a particular favorite that airs between now and Friday at 8pm

the weekly repeat would obviously need to be exempt from the look ahead property


Hope i have explained this well enough, just some thoughts,
thanks for your work

-ek

Last edited by ekiwi; 07-19-2006 at 06:37 PM.
Reply With Quote
  #9  
Old 07-19-2006, 06:14 PM
something fishy something fishy is offline
Sage Advanced User
 
Join Date: Sep 2004
Posts: 240
@Flachbar
OK I understand what you're saying. I was thinking that you only needed to parse the favourite strings to identify the anti favourites, but of course I now see that you need to work within the limits of the Sage core (so my example wouldn't work because Sage would treat ANDNOT as just another keyword and therefore never record anything?).

No worries, these strings are only set infrequently so the syntax that you use isn't a problem; the functionality is great.

Cheers
Eric
Reply With Quote
  #10  
Old 07-23-2006, 08:55 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Hi ekiwi,

Quote:
Originally Posted by ekiwi
An AntiFavorite based on a time range 0100-1900 would leave me with only the prime time shows.
Makes sense. I just posted v1.1 which includes this feature. You can now specify an exclusion range for IR and regular favorites:

dl-time-01:00-19:00
wd-time-20:00-22:00-favt-mad about you

I also added the ability to trigger another exclusion scan manually by pressing 'PLAY' while in the log screen.


You other suggestion would involve a lot of work to implement (scanning and computing the recording history, etc), so it's not very likely to get implemented, at least for now

Dirk
Reply With Quote
  #11  
Old 07-23-2006, 09:02 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Hi Eric,

Quote:
Originally Posted by something fishy
@Flachbar
but of course I now see that you need to work within the limits of the Sage core (so my example wouldn't work because Sage would treat ANDNOT as just another keyword and therefore never record anything?).
Yep, exactly...


Dirk
Reply With Quote
  #12  
Old 07-29-2006, 08:09 PM
ekiwi ekiwi is offline
Sage User
 
Join Date: May 2004
Posts: 65
thanks for adding the time based option. I am however feeling stupid as i cant get anything to work at all

steps i take are.

create a keyword favorite
wd-title-unfabulous
all fields

go to exclude log press play and it reports no shows marked with the current time
go to search by title
unfabulous
and there are 2 upcoming shows today both unwatched

i have tried with only dynamic menus and your import. Can i turn on debuging i notice there is a df debug level parameter in the properties file

i am running sagetv v50412 with the background sage recording service

ps as noted on some other threads some people (inc me) use the PLAY/PAUSE function could you add this to also trigger a run of the task.

TIA

Last edited by ekiwi; 07-29-2006 at 08:16 PM.
Reply With Quote
  #13  
Old 07-29-2006, 09:54 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by ekiwi
thanks for adding the time based option. I am however feeling stupid as i cant get anything to work at all

steps i take are.

create a keyword favorite
wd-title-unfabulous
all fields

go to exclude log press play and it reports no shows marked with the current time
go to search by title
unfabulous
and there are 2 upcoming shows today both unwatched

i have tried with only dynamic menus and your import. Can i turn on debuging i notice there is a df debug level parameter in the properties file

i am running sagetv v50412 with the background sage recording service

ps as noted on some other threads some people (inc me) use the PLAY/PAUSE function could you add this to also trigger a run of the task.

TIA
Hi ekiwi,

so the 'unfabulous' show gets scheduled by IR, right ?

Yes, please set "debug_logging=TRUE" and "plugins/df/debug_level=1" in SageClient.properties, restart the UI, trigger another scan, and attach the "sagetvclient_0.txt" in your post, this might show me what is going wrong ...

Dirk
Reply With Quote
  #14  
Old 07-30-2006, 05:15 AM
ekiwi ekiwi is offline
Sage User
 
Join Date: May 2004
Posts: 65
Ive solved my own problem the debug showed me the way

I use XMLTV files screenscraped for my epg. Things are never quite right so most of my favorites are keyword title favorites

i had tried using both of these forms
WD-KEYWORD-MIAMI-FAVT-CSI
WD-KEYWORD-MIAMI-FAVK-CSI

but looking at the log i Figured the correct form is
WD-KEYWORD-MIAMI-FAVK-TITLE:CSI

you might want to add the following two lines to your syntax in the first post.
wd-keyword-title:xxxx
dl-keyword-title:xxxx

ps you where right in an attempt to simplify things to get something working i had moved to the IR only form which is why the unfortunately didnt work

Last edited by ekiwi; 07-30-2006 at 05:39 AM.
Reply With Quote
  #15  
Old 07-30-2006, 05:39 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by ekiwi
Ive solved my own problem the debug showed me the way

I use XMLTV files screenscraped for my epg. Things are never quite right so most of my favorites are keyword title favorites

i had tried using both of these forms
WD-KEYWORD-MIAMI-FAVT-CSI
WD-KEYWORD-MIAMI-FAVK-CSI

but looking at the log i Figured the correct form is
WD-KEYWORD-MIAMI-FAVK-TITLE:CSI

you might want to add the following two lines to your syntax in the first post.
wd-keyword-title:xxxx
dl-keyword-title:xxxx

ps you where right in an attempt to simplify things to get something working i had moved to the IR only form which is why the unfortunately didnt work
Hi ekiwi,

thanks a lot for pointing this out. I have never used 'keyword-title favorites' myself and wasn't aware that the generated favorite keyword looks that way. I will add this as a note to the first post.

Dirk
Reply With Quote
  #16  
Old 08-01-2006, 08:23 AM
something fishy something fishy is offline
Sage Advanced User
 
Join Date: Sep 2004
Posts: 240
Hi Dirk

Quote:
unzip the installation file into SageTV directory (e.g. C:\Program Files\SageTV\SageTV). Make sure to preserve the directory structure. This will copy df_sageutils.jar and df_sageplugins.jar to JARs and favorite_excluder.xml to STVs\SageTV3
The current download (and v1.1 also) only contains df_sage_plugins.jar and favorite_excluder.xml and doesn't seem to work on my system (and no evidence in the log file).

Cheers
Eric
Reply With Quote
  #17  
Old 08-01-2006, 08:32 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by something fishy
Hi Dirk


The current download (and v1.1 also) only contains df_sage_plugins.jar and favorite_excluder.xml and doesn't seem to work on my system (and no evidence in the log file).

Cheers
Eric
I just checked and you are right, the other jar file was missing ... I updated the download file, so you might want to re-download and see if this was the causing the problem ...

Dirk
Reply With Quote
  #18  
Old 08-01-2006, 09:11 AM
Jason's Avatar
Jason Jason is offline
Sage Expert
 
Join Date: Nov 2003
Location: Texas
Posts: 598
Quote:
Originally Posted by flachbar
The way to define the marking criterias is certainly cumbersome right now, it would need a nice GUI to to define the conditions in a simple way instead of using cryptic keywords. But I dont think I'll ever have the time for doing this, maybe someone else here will get interested.
Dirk-

I just read this thread and I can say that this import is great! Wow...! I was thinking however, that a GUI for this seems unnecessary... at least for SageMC. While this may be off-topic for this thread and more appropriate for the SageMC thread, could this be added to the latest Dev build of SageMC? With the appropriate dialog, from the Suggestions screen of SageMC, a new button could be added to add New Suggestions to the anti-favorites 'favorites'. Most of the other 'skins' have to add the specific plugins to get to the level that SageMC is at simply stock! This would add some extra differentiation to the SageMC skin... kind of like the built in ComSkip/SA feature!

-Jason

Last edited by Jason; 08-01-2006 at 09:39 AM.
Reply With Quote
  #19  
Old 08-02-2006, 05:58 PM
something fishy something fishy is offline
Sage Advanced User
 
Join Date: Sep 2004
Posts: 240
Dirk

That sorted it, working now.

Cheers
Eric
Reply With Quote
  #20  
Old 08-09-2006, 02:49 AM
something fishy something fishy is offline
Sage Advanced User
 
Join Date: Sep 2004
Posts: 240
Sorry Dirk I spoke too soon

The plugin works when I manually force a scan from the exclude log page but I can't seem to make it scan every sixty minutes.

I'm running Sage in service mode and Sageclient.properties contains:
plugins/df/debug_level=0
plugins/df/favorite_excluder/enabled=TRUE (I've tried '=true' and indeed '=FALSE' and '=false')
plugins/df/favorite_excluder/lookahead=72
plugins/df/favorite_excluder/scan=schedule

I'm running the latest version of SageMC (6.8a) with no other plugins on Java 1.5.2. I use xmltv and the LM Gestion importer.

Any ideas

Cheers
Eric
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


All times are GMT -6. The time now is 12:55 PM.


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