TV Server Plugin: TvWishList | Page 47

Discussion in 'TV-Server Plugins' started by huha, January 19, 2010.

    • Premium Supporter

    foxbenw MP Donator

    System Specs
    useDescription is true if identical descriptions should be skipped?
    Edit: I understand. I think neither of these is what I meant. I will get back to you.
    • Premium Supporter

    huha Thread Starter Extension Developer

    System Specs
    Ben,
    useDescription is the user checkbox. If it is checked it will be used as a skipping criteria if the old and new schedule do match.

    Sleeping one more night I came up with the following proposal:

    For the MediaPortal plugin the following menue "Skip repeated Episodes" will be displayed:


    -Never
    -Automatic

    -Match Description / Ignore Description
    -Match Episode Part / Ignore Episode Part
    -Match Episode Name / Ignore Episode Name
    -Match Episode Numbers / Ignore Episode Numbers

    The Tvserver plugin will keep the dropdown box with the following options:

    -Automatic
    -Description
    -Description+Episodename
    -Description+Episodename+Episode Numbers
    -Description+Episodename+Episode Part
    -Description+Episodename+Episode Part+Episode Numbers
    -Episodename
    -Episodename+Episode Numbers
    -Episodename+Episode Part
    -Episodename+Episode Part+Episode Numbers
    -Episode Numbers

    The checkbox skip repeated episodes (corresponding to Never in the MP plugin) remains


    The algorithm for skipping an episode will then be (assuming that skip_repeating _episodes is true):


    if (useAutomatic) //automatic modus
    {
    if (newDescription == oldDescription)
    {
    // Log.Debug("Description true");
    if (newEpisodePart == oldEpisodePart)
    {
    //Log.Debug("EpisodePart true");
    if (newEpisodeName == oldEpisodeName)
    {
    //Log.Debug("EpisodeName true");
    if (newSeriesNumber == oldSeriesNumber)
    {
    //Log.Debug("SeriesNumber true");
    if (newEpisodeNumber == oldEpisodeNumber)
    {
    //Log.Debug("EpisodeNumber true");
    //Log.Debug(" ==> EpisodeManagement = true");
    return true;
    }//EpisodeNumber
    }//SeriesNumber
    }//EpisodeName
    }//EpisodePart
    }//Description
    //Log.Debug("episodeManagement = false");
    }


    else //manual selection of criteria


    {
    if ((newDescription == oldDescription) && (newDescription != string.Empty) || (!useDescription))
    {
    // Log.Debug("Description true");
    if ((newEpisodePart == oldEpisodePart) && (newEpisodePart != string.Empty) || (!usePart))
    {
    //Log.Debug("EpisodePart true");
    if ((newEpisodeName == oldEpisodeName) && (newEpisodeName != string.Empty) || (!useName))
    {
    //Log.Debug("EpisodeName true");
    if ((newSeriesNumber == oldSeriesNumber) && (newSeriesNumber != string.Empty) || (!useNumbers))
    {
    //Log.Debug("SeriesNumber true");
    if ((newEpisodeNumber == oldEpisodeNumber) && (newEpisodeNumber != string.Empty) || (!useNumbers))
    {
    //Log.Debug("EpisodeNumber true");
    //Log.Debug(" ==> EpisodeManagement = true");
    return true;
    }//EpisodeNumber
    }//SeriesNumber
    }//EpisodeName
    }//EpisodePart
    }//Description
    //Log.Debug("episodeManagement = false");

    }//end Automatic


    This would allow for standard users to enable an automatic algorithm (default), which probably will be fine for 80% of the users without making any difficult selections or a need for detailed understanding of their EPG data. Experts can then select the matching criteria for each tv wish individually.
    Do you see any case where this concept would not work?
    Greetings, huha
    • Premium Supporter

    foxbenw MP Donator

    System Specs
    So far i haven't seen any case where we would want to use episode part and episode name separately. I don't know if it is better to have it separately for future use, or wait until someone needs it.
    In the MP plugin are the last 4 options for the manual override? Or do they change the default setting? I can't quite picture it from what you have written.

    I don't understand why you need two sets of code. Shouldn't automatic be the same as manual, except useDescription etc take some default value? The way you have it now, the blanks will be treated differently for each. Perhaps that is on purpose. I think this might explain why in one of my previous posts the 'fresh meat' wish was returning skip = true. useDescription = false, default = true, and episodeName and episode/seriesNumber were blank.

    Also, using this code, if useDescription = useName = usePart = useNumbers = false
    the program is skipped?
    You may need to change the last nested if statement to allow for that.

    Before I saw what you had written I think something like this was what was in my head. The logic between the criteria is OR not AND. ie any match on a criteria is enough to skip, rather than all of them having to match. I assume you have thought about it and rejected this for some reason in the past! Sorry if anything is wrong, I have only ever done amateur VBA.

    if ((newDescription == oldDescription) && (newDescription != string.Empty) && (useDescription) )
    {
    return true;
    }

    if ((newSeriesNumber == oldSeriesNumber) && (newSeriesNumber != string.Empty) && (useNumbers) )
    {
    if ((newEpisodeNumber != string.Empty) && (newEpisodeNumber == oldEpisodeNumber)) {
    return true;
    }
    }// if series number exists but there is no episode number it will not skip.

    if ((newEpisodeName == oldEpisodeName) && (newEpisodeName != string.Empty) && (useNames) )
    {
    if ((newEpisodePart == string.Empty) || (newEpisodePart == oldEpisodePart)) {
    return true;
    }
    }//different to numbers. an empty episode part allows for skipping.

    return false;


    Ben
    • Premium Supporter

    huha Thread Starter Extension Developer

    System Specs
    Ben,

    - the last four options in the MP plugin are for the overwrite of a single tv wish, not the defaults.
    - in my code the episode would be skipped if all matching criteria are disabled and the title is the same. I thaught it is important to give the user a choice to skip based on a title match only.

    -Ok, I see here we had a major misunderstanding with the AND and OR conjunction for matching criteria.
    The reason i came up with AND was that there were a lot of EPG data which had the same description for all episodes.
    So you can say that´s why the user can disable the description.

    But based on your proposal what do you think about the following version?


    if (useNumbers) //check for seriesnumber and episodenumber must be first
    {
    if ((newSeriesNumber == oldSeriesNumber) && (newSeriesNumber != string.Empty))
    {
    if ((newEpisodeNumber == oldEpisodeNumber)&&(newEpisodeNumber != string.Empty) )
    {
    return true; //series number and episode number do match
    }
    else if ((newEpisodeNumber != oldEpisodeNumber) && (newEpisodeNumber != string.Empty) && (oldEpisodeNumber != string.Empty))
    {
    return false; //true mismatch of episodenumber
    }
    }// if series number exists but there is no episode number it will not skip.
    else if ((newSeriesNumber != oldSeriesNumber) && (newSeriesNumber != string.Empty) && (oldSeriesNumber != string.Empty))
    {
    return false; //true mismatch of series number
    }
    }

    if (useName) //check for episode name and episode part
    {
    if ((newEpisodeName == oldEpisodeName) && (newEpisodeName != string.Empty))
    {
    if ((newEpisodePart == oldEpisodePart) || (newEpisodePart == string.Empty))
    {
    return true; //Episode name is matching and episode part is matching or is empty
    }
    else if ((newEpisodePart != oldEpisodePart) && (newEpisodePart != string.Empty) && (oldEpisodePart != string.Empty))
    {
    return false; //true mismatch of episodepart
    }
    }
    else if ((newEpisodeName != oldEpisodeName) && (newEpisodeName != string.Empty) && (oldEpisodeName != string.Empty))
    {
    return false; //true mismatch of episodename
    }
    }

    if (useDescription) //check for description must be last
    {
    if ((newDescription == oldDescription) && (newDescription != string.Empty) )
    {
    return true; //Description is matching
    }

    }

    if (!useNumbers && !useName && !useDescription)
    {
    return true; //enables the user to skip just for identical title if nothing is checked, skip repeated checkbox still needed
    }


    return false; //no unique matches or mismatches do not know
    }
    • Like Like x 1
    • Premium Supporter

    foxbenw MP Donator

    System Specs
    -OK. And then the drop down in TV server is changed depending on which ones are enabled/disbaled. I guess all are enabled by default now, with the new logic. Will you retain the default choices in the tv server plugin? Perhaps not, but I don't feel strongly either way.
    -This is the same as record only once? Maybe you could disable the whole skip routine if record only once is true? I don't know if that is easy within the way you have written it, of course.
    nb thaught = thought. (that is meant helpfully not critically!)

    with the new logic, i think i like it. however i need to think about it some more. it is also where my mind went after my last post.
    i wonder if there are a few more specific situations that we want to include?
    eg

    if ((newEpisodeNumber = string.Empty) != (oldEpisodeNumber = string.Empty))
    {
    return true;
    }

    I currently don't know where this should go in the new hierarchy but suspect it would be useful.
    Like i said, i will think some more and try to come up with any refinements which would be useful. I wanted to give you that example above in case it got you thinking.
    The new logic may end up with the same answers as your original logic, just in a different order! But i think it is worth it.
    Ben
    • Team MediaPortal

    mbuzina Test Group

    System Specs
    I am not sure if I use WhishList correctly. I want to record every instance of a news program (Tagesschau) and only store the last x occurences. I thought you could do that with keep episodes, but it does not get all schedules, only 1

    issue or user error?
    • Premium Supporter

    huha Thread Starter Extension Developer

    System Specs
    mbuzina,
    i do need a log file from you to see your settings. It should work.

    Ben,

    I got a new version including the MP plugin.

    -I have deleted the default values as I think the only useful default will be all criteria enabled. If a user disagrees the MP plugin allows to define user specific default values for each item.

    -In principle you are right, but this feature will also be used to check if a record once tv wish has been already recorded or deleted. So i will keep it in to enable the user this option. The structure of the algorithm I do not want to change again.

    I do feel that this is now much better thanks to your help compared to what I had before and especially like that the EPG data are now being searched and matched by quality first. Saying this I mean episode number should always fit and will be searched first, names are quite reliable, too. The Description, where i have found most issues (and i think you made the same experience), will be searched last and only evaluated if there is no clear true/false decision from the previous criteria.

    I assume with your latest criiteria you wanted to return "true" if one is empty and the other one is not empty. Correct? As we do not know the data of the other one I would do this may be in the end or return false as we are not sure if they match. Following your words it is better to record twice than to skip once the wrong one.

    If you have other ideas it will be easy now in the current structure to modify the search criteria, as it is included in a separate routine.

    Greetings, huha

    Update: Include Recordings for Preferred Groups does not work yet!

    Attached Files:

    • Like Like x 1
    • Premium Supporter

    foxbenw MP Donator

    System Specs
    I think this is going to be great. Thanks!

    1 Using the new one, I get a load of repeats using skip = true and criteria = name.
    I just ran one wish, for American Dad. name = "Jack's back" is an example repeat. Log attached.
    I couldn't tell if it was caused by the new logic because description, name and number are all identical. But you also added the new field for the future functionality in preferred groups so I can't tell what is causing it.

    2 New layout
    I see you have removed the defaults. I don't think that removes any functionality. I think it is quite intuitive.
    In MP plugin, initially i was a bit confused. A suggestion:
    title of menu = "Change episode matching criteria"
    (and if possible do not show the ": currentvalue" in the previous screen because it can't list all of the options you have selected in one line)

    Then in the menu:
    Skip matching Episode Name? (Yes)/Skip matching Episode Name? (No)
    Skip matching Series and Episode Number? (Yes)/Skip matching Series and Episode Number? (No)
    Skip matching EPG descriptions? (Yes)/Skip matching EPG descriptions? (No)
    //then a blank row
    Turn on all criteria
    Turn off all criteria

    ps I don't know where the EPG repeater marker is used because we haven't talked about it. I don't use it because I don't have them in my EPG, but happy to discuss it if you want to.

    3 The new logic
    I have one issue with the logic which is caused by epg data. The season 10 finale of Smallville is split into two parts, with the same episode and series numbers, but different names ("finale (part 1)" and "finale (part 2)"). Using the new OR criteria with name+number skips the second part of the show. I have no idea if this is common. It makes me wonder if just name and number should be AND (like your original code) instead of OR, with description coming afterwards as an OR, but I don't know the answer. Of course, I can use name only now just for that wish (which makes me happy!) but I would not have known about it unless I looked and had seen that it had been skipped.
    It also made me realise - isn't episode part in the same hierarchy as series and episode #, rather than name?

    With the blanks, you are correct, my idea was to force a record if only one of the fields were blank. But it doesn't seem to fit neatly in a particular order. If anything comes to mind I will make a suggestion.

    Good work!
    Ben

    Attached Files:

    • TvWishList.log
      File size:
      2.4 MB
      Uploaded:
      February 14, 2012
      Views:
      1
    • Like Like x 1
    • Premium Supporter

    huha Thread Starter Extension Developer

    System Specs
    Ben,

    1) I found a bug with new includerecordings

    2) Changed. If you find more things you can change directly in C:\ProgramData\Team MediaPortal\MediaPortal\language\TvWishListMP\strings_en.xml

    3)
    I would never have thaught that this could happen. I have included in the beginning a new check:

    if (useNumbers && useName && (newSeriesNumber != string.Empty) && (newEpisodeNumber !=

    string.Empty) && (newEpisodeName != string.Empty))//check for seriesnumber and episodenumber and

    episodename only for true
    {
    if ((newEpisodeNumber == oldEpisodeNumber) && (newSeriesNumber == oldSeriesNumber) &&

    (newEpisodeName == oldEpisodeName))
    {
    return true; //series number and episode number and episode name do match
    }
    //do not ask for mismatch, this will be covered by later criteria
    }

    Greetings, huha

    Attached Files:

    • Like Like x 1
    • Premium Supporter

    foxbenw MP Donator

    System Specs
    Nice. This is now returning everything I would want/expect from each wish.

    FYI, sometimes in UK epg a show does not get given any episode name/number until about a week before it is aired, but it can have a title from 10 days before (depending on how much epg data you grab).
    Therefore if i don't have description = true for a particular wish, all episodes beyond a week are being scheduled. It is behaving correctly, of course.
    I am hoping that as episode name/number gets filled in the epg as they become <7 days that they will be removed properly. I will let you know if not.

    Good work, thanks!
    Ben
    • Like Like x 1

Share This Page

Users Viewing Thread (Users: 0, Guests: 0)

Running the latest version?

V1.3.0 FINAL - released March 2013
Releasenews | Download
Changelog
 | Requirements
HTPC
Team-MediaPortal
 
About
Contact |  Press
Partners