Add "Icon" to program database from xmltv import, make available to skins (1 Viewer)

Status
Not open for further replies.

Blue Lightning

Portal Member
October 8, 2011
49
52
Home Country
Antarctica Antarctica
I've developed a patch that adds a new property to programs in the TV database, imports it from xmltv, and makes this property available to skins.

Purpose
: to store the URL/path of a program image in the TV database, and makes it available for skins in the TV guide, scheduler, and search.

Patch/code: The .diff patch is here http://pastebin.com/aWfSQfkM - The upgrade queries are ALTER TABLE program ADD COLUMN icon VARCHAR(200) NOT NULL DEFAULT ""; ALTER TABLE recording ADD COLUMN icon VARCHAR(200) NOT NULL DEFAULT "";
Patch for TVE3.5: This is untested and doesn't have most of the MP client changes http://pastebin.com/d46BZ87j

Test data: Import xmltv data that has an <icon> on some programs (here's a sample http://pastebin.com/RALw5TgG), edit mytvguide.12Lines.xml (or 9 lines), find texture #TV.Guide.thumb and change it to #TV.Guide.Icon and then view the TV Guide. https://i.imgur.com/1kuAmLY.png

Documentation: A TV program's "Icon" is an optional element in the XMLTV specification in the format of <icon src=""> eg <icon src="https://forum.team-mediaportal.com/MediaPortal-HTPC-Media-Center15b.png"> as specified in the xmltv specification (if missing it'll just be empty, no error). XMLTV data imports this into the database and is then made available to skins as #TV.Guide.Icon, #TV.Scheduled.Icon, and #TV.Search.Icon (for the TV Guide, the list of scheduled programs, and search results respectively).
See https://forum.team-mediaportal.com/threads/allow-skins-to-cache-a-web-image.135894/ for documentation on the texture saving


Would it be possible to have this patch (and database upgrade queries) added to an upcoming MediaPortal update? If not, what can be done to improve it?
 
Last edited:

Blue Lightning

Portal Member
October 8, 2011
49
52
Home Country
Antarctica Antarctica
I've updated the patch with support for https files (Mediaportal only downloads http at the moment) and saving png files as png (instead of gif). Having them as png means it doesn't go over some gif specific code and could improve performance slightly (in theory).

I haven't figured out a simple way to do caching but other than that this is ready to go. Can it be reviewed?
 

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    hello @Blue Lightning
    thank you for your contribution, it's really an great improvement,
    i don't know, if you know, but TVE devellopement is in freeze code, because Dev, work on it, and it's an big rework.

    the best way is ask @mm1352000 on the ability to know, if this rework can be done on existing TVE or can only be ported to the next TVE3.5.

    if you can provide an patch for the TVE3.5 branch, i'm 90% sure (yes missing 10%, because i'm not dev, and can't say YES) than MM will includ your work inside the branch .
    https://github.com/MediaPortal/MediaPortal-1/tree/EXP-TVE3.5-MP1-MP2_mm_working

    So, thank you yet
     

    Blue Lightning

    Portal Member
    October 8, 2011
    49
    52
    Home Country
    Antarctica Antarctica
    I didn't change any file size limits, I just changed the line where it was checking if it was a web address. The line was
    if (lowerFileName.IndexOf(@"http:") >= 0)
    now
    if (lowerFileName.IndexOf(@"http:") >= 0 || lowerFileName.IndexOf(@"https:") >= 0)
    I didn't notice any filesize limits in the code but if there are limits it'll be the same


    i don't know, if you know, but TVE devellopement is in freeze code, because Dev, work on it, and it's an big rework.

    the best way is ask @mm1352000 on the ability to know, if this rework can be done on existing TVE or can only be ported to the next TVE3.5.
    Does TVE3.5 work in MP1? I can give it a try if yes. Is there a roadmap/issue for TVE3.5 that I can look at?
     

    Blue Lightning

    Portal Member
    October 8, 2011
    49
    52
    Home Country
    Antarctica Antarctica
    I've added a patch for TVE3.5 to the first post. I can't test it so it should be reviewed (might be defining Icon in places it doesn't need to be?).
    The patch for current TVE3 is tested and works, I just can't compile/run the TV server for 3.5
     

    Blue Lightning

    Portal Member
    October 8, 2011
    49
    52
    Home Country
    Antarctica Antarctica
    I've updated the patch (for TVE3 and MP1, no changes to the TVE3 bit though just the client) with a way for skins to say they want the remote image cached to the filesystem. This makes image loading faster (no need to re-download it from the website). Images cached this way are deleted when they haven't been touched for 3 days. (Linking this up to some setting in the future would be good). Tested and working.
     

    Blue Lightning

    Portal Member
    October 8, 2011
    49
    52
    Home Country
    Antarctica Antarctica
    I updated the pastebin links to work again.

    Regardless of what might happen with TVE3 and 3.5, could the mediaportal/Core/guilib/ bits please be added for the MP 1.17 client? That's the code for downloading and caching a web image if a skin indicates it wants it cached (see above post). I could submit that as a patch on its own if needed. EDIT: Submitted https://forum.team-mediaportal.com/threads/allow-skins-to-cache-a-web-image.135894/
     
    Last edited:

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    hello @Blue Lightning
    can you update your patch ( based on latest master) , and provide an patch file instead of pastebin link ( or an github branch dedicated to each "rework/feature" ), please ?
    it's very more easy for our dev team.

    @Developers
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom