Add "Icon" to program database from xmltv import, make available to skins (2 Viewers)

Status
Not open for further replies.

Blue Lightning

Portal Member
October 8, 2011
49
52
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
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,603
    5,226
    France - IDF
    France France
    Country flag
    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
    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
    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
    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
    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:
    Status
    Not open for further replies.

    Users Who Are Viewing This Thread (Users: 0, Guests: 2)

    OP Similar threads Forum Replies Date
    E Can I add folder icons to my list of videos MediaPortal 1 Talk 9
    ajs [solved] Add CI AppVeyour to github account MediaPortal 1 46
    M Add Radio channels and EPG to Mediaportal xmlTV 2
    horned_reaper [solved] Add support for Bluetooth events Improvement Suggestions 2
    ajs [WiP] 5030: Add UHD Thumb size to TV Server MediaPortal 1 0
    ajs [fixed] 5029: Add the ability to choose the type of pause for designers in the slideshow MediaPortal 1 4
    P MP 2 - Request to add an additional TV series Filename protocal Feature Requests 0
    raffe How to add 500+ streams? OnlineVideos 1
    T How to add missing buttons IR Server Suite (IRSS) 0
    R [solved] Moving pictures importer wont add files from a removable drive. Is there a work around ? Moving Pictures 8
    cbr954rr Possibillity to add more Movie Folders in Menu General 5
    ajs [solved] 4935: Add string.replace function to Skin engine MediaPortal 1 10
    haaitje Crashes when trying to add lyrics MPTagThat 0
    H Add site to home OnlineVideos 5
    Timothy Cobb Mediaportal 2 Weather - Can't add Weather locations Plugin Development 5
    E How can I add some site to Online Video Plugin ? OnlineVideos 4
    J silly question: where do I add my login details!! OnlineVideos for MediaPortal 2 5
    T Animated circular icon persists in centre of screen. General 10
    M App Icon starts Configuration Installation, configuration support 3
    R TV menu icon does not work to return from sub-menu item Submit: Bug Reports 4
    CyberSimian Has anyone ever seen a multichannel-audio icon for TV? Watch / Listen Media 15
    T Moving Pictures Icon disappeared...and the program....??? Watch / Listen Media 1
    R MP 2.2.3 Search TV program only with the correct begin of show title General 7
    J [solved] Newbie to MediaPortal 2 - Cannot open/run TV programs Newcomers Forum 4
    R Visual status of watched TV programs MediaPortal 1 Talk 2
    Similar threads

























    Top Bottom