Add "Icon" to program database from xmltv import, make available to skins

Discussion in 'Submit: code patches (MediaPortal/TV-Server/etc.)' started by Blue Lightning, October 10, 2016.

Thread Status:
Not open for further replies.
  1. Blue Lightning

    Blue Lightning Portal Member

    Joined:
    October 8, 2011
    Messages:
    49
    Likes Received:
    26
    Ratings:
    +43 / 0
    Home Country:
    Australia Australia
    Show System Specs
    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: January 9, 2017
    • Like Like x 2
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Blue Lightning

    Blue Lightning Portal Member

    Joined:
    October 8, 2011
    Messages:
    49
    Likes Received:
    26
    Ratings:
    +43 / 0
    Home Country:
    Australia Australia
    Show System Specs
    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?
     
    • Like Like x 1
  4. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,188
    Likes Received:
    2,252
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +3,877 / 13
    Home Country:
    France France
    Show System Specs
    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
     
    • Like Like x 1
    • Informative Informative x 1
  5. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,404
    Likes Received:
    2,486
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,406 / 29
    Home Country:
    Ukraine Ukraine
    Show System Specs
    How about Large files? 1Mb, 2Mb, 3Mb .. 5Mb Filesize?
     
    • Like Like x 1
  6. Blue Lightning

    Blue Lightning Portal Member

    Joined:
    October 8, 2011
    Messages:
    49
    Likes Received:
    26
    Ratings:
    +43 / 0
    Home Country:
    Australia Australia
    Show System Specs
    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


    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?
     
    • Thank You! Thank You! x 1
  7. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,188
    Likes Received:
    2,252
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +3,877 / 13
    Home Country:
    France France
    Show System Specs
    not yet,
    not possible to build, also for testing,
    @mm1352000 is on many rework, and only him can say you, what parts must be reworked,
    or maybe @Developers
     
    • Informative Informative x 1
  8. Blue Lightning

    Blue Lightning Portal Member

    Joined:
    October 8, 2011
    Messages:
    49
    Likes Received:
    26
    Ratings:
    +43 / 0
    Home Country:
    Australia Australia
    Show System Specs
    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
     
    • Thank You! Thank You! x 3
  9. Blue Lightning

    Blue Lightning Portal Member

    Joined:
    October 8, 2011
    Messages:
    49
    Likes Received:
    26
    Ratings:
    +43 / 0
    Home Country:
    Australia Australia
    Show System Specs
    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.
     
    • Like Like x 1
    • Thank You! Thank You! x 1
  10. Blue Lightning

    Blue Lightning Portal Member

    Joined:
    October 8, 2011
    Messages:
    49
    Likes Received:
    26
    Ratings:
    +43 / 0
    Home Country:
    Australia Australia
    Show System Specs
    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: January 9, 2017
    • Thank You! Thank You! x 1
  11. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,188
    Likes Received:
    2,252
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +3,877 / 13
    Home Country:
    France France
    Show System Specs
    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
     
    • Like Like x 2
Loading...
Thread Status:
Not open for further replies.

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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!