Request: 3 new custom view filters (1 Viewer)

Michael_M112

Portal Member
July 1, 2009
11
1
Home Country
Germany Germany
Hi,

i figuered out how to add custom view filters using the SQLite Database Browser, but I have no idea what I have to type in the viewConfig column to get the desired effect. I'd like to have filters for episodes that

- are unwatched AND already aired (the built in filter includes episoded with airdates in the future)
- recently aired AND do NOT have an existing local file reference (some sort of "shopping" list)
- have NO user rating (for episodes I forgot to rate)

I'd appreciate any help. Thanks.
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Just add a new view/filter from within MP-TVSeries GUI or Configuration, then close it, and use your SQLite tool to edit the pseudo-SQL query that goes along with those 'new' views and/or filters that you just created.

    Then you can use those views/filters as you would any other.
     

    Michael_M112

    Portal Member
    July 1, 2009
    11
    1
    Home Country
    Germany Germany
    Thanks for your reply. Unfortunately you explained the part i know how to do and skipped the part I need help with ;-)

    I don't know how to phrase the "pseudo-SQL queries". Any tips on that?
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Look closely at all the existing pseudo-SQL qeuries on the existing views that you can add via MP-TVSeries config.

    It's not actual SQL code, hence the pseudo term, but it relates very close to it. If you have exprience with SQL queries, then looking closely at all the examples, you can figure out pretty much anything you want to do.

    Example (that I use myself): series<;><Series.Status>;=;Continuing<cond><Series.EpisodeCount>;=;2<cond><Series.EpisodesUnWatched>;=;1<;><;><nextStep>season<;><;><Season.seasonIndex>;asc<;><nextStep>episode<;><;><Episode.EpisodeIndex>;asc<;>

    Which looks for series still ongoing (<Series.Status>;=Continuing) with (AND == <cond>) with exactly 2 episodes (<Series.EpisodeCount>;=;2) where also (AND == <cond>) the episodes are unwatched (Series.EpisodesUnWatched>;=;1)

    So the <cond>...... is what you use to get your 'AND' part to work, but it works best when the same SQL table is used to match, in the above example 'Series'.
     

    Michael_M112

    Portal Member
    July 1, 2009
    11
    1
    Home Country
    Germany Germany
    Thanks again. I will look into that, when I had some sleep. It's 4AM here and I'm getting older.
     

    Michael_M112

    Portal Member
    July 1, 2009
    11
    1
    Home Country
    Germany Germany
    I finaly had the time to try adding the filters. It almost worked, I just have one Problem. What is the correct syntax to check if a value is NOT NULL. For my unwatched filter I use the following code:

    Code:
    episode<;><Episode.FirstAired>;<=;<today><cond><Episode.Watched>;=;0<;><Episode.FirstAired>;desc<;>

    which does exactly what I want, but I still need to exclude episodes with no Airdate. I guess I'll need to add another

    <cond><Episode.FirstAired>???
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    I know sql and linq but I can't understand this syntax. :(
    what are <> and ; means?
    I want to set unwatched&local view.
     

    Michael_M112

    Portal Member
    July 1, 2009
    11
    1
    Home Country
    Germany Germany
    I got the unwatched filter to work by checking if <Episode.FirstAired>!=''. I used <> intead of != first, which was obviously wrong.

    That's the resulting code (displays episodes that have an airdate in the past and are unwatched):
    Code:
    episode<;><Episode.FirstAired>;<=;<today><cond><Episode.FirstAired>;!=;''<cond><Episode.Watched>;=;0<;><Episode.FirstAired>;desc<;>

    Edalex: I don't know what kind of syntax this is either. I just used one of the existing filters and modified it. I still haven't figured out how to check if an episode is (not) available localy. I tried <Episode.isAvailable>!=1, <Episode.EpisodeFilename>='' but both ways didn't work.

    I also still have problems with the userratings filter. <Episode.myRating>='' returns no results. Checking for a specific rating works, so i could check for all episodes with <Episode.myRating>!=10, AND !=9 ..... AND !=1 but im sure there is a smarter way.
     
    Last edited:

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    Michael_m112, try <Episode.myRating>!=0 (could be wrong)

    Ratings are treated as INTS so that should work for when empty.

    Regarding the syntax, Inker the original author of the plugin quickly whipped the view system and syntax up (with regret I believe) :0.

    fyi, I believe there is only support for 3 <cond> conditions. So doing one for each rating wont work.
     

    Users who are viewing this thread

    Top Bottom