[solved] MP2 TV Logo Management (1 Viewer)

Nordfinn

MP Donator
  • Premium Supporter
  • January 18, 2014
    86
    8
    Home Country
    United States of America United States of America
    Ok, I've done all those things exactly, but it's not working. As soon as I open MP2, certain logos that have placed in the local folder (C:\ProgramData\Team MediaPortal\MP2-Server\Logos\Tv-Flat-Local) get replaced by logos that the program must be downloading from the repository. My "Channel logo style" is selected as "Flat-local."

    I checked back, and it is indeed 14 days since I made the change. It worked for 14 days--that is, showed my local logos in theEPG, But now, not working at all, and I haven't changed anything.

    As an example: In my local folder, before restarting server and client (and performing a system restart) I had placed the first attached .png file (which I had been using for the previous 14 days) in the local folder. When I restarted, it had been replaced with the second attached file, which now shows in the EPG. So not working at all. Very frustrating, and the worst of it is losing logos that I had gathered, because I didn't think to copy them elsewhere.
     

    Attachments

    • PIX11.png
      PIX11.png
      6.5 KB
    • PIX11.png
      PIX11.png
      20.3 KB

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,709
    3,492
    Stuttgart
    Home Country
    Germany Germany
    Ok, thats bad then. I tagged already the correct developer, but the chance for response or finally an activity is very low :)
    I can not really code C#, but I found the corresponding code responsible for the logo chaching decision.
    XML:
        private bool IsCacheValid(Theme theme, string logoFileName)
        {
          FileInfo fi = new FileInfo(logoFileName);
          return theme.SkipOnlineUpdate || DateTime.Now - fi.CreationTime <= MAX_CACHE_DURATION;
        }
    The code seems correct and the result should be true, when SkipOnlineUpdate is true.
    I changed the code to below so the result is regardless of anything true and built a new library for you.
    XML:
        private bool IsCacheValid(Theme theme, string logoFileName)
        {
          return true;
        }
    Can you extract attached files in "C:\Program Files (x86)\Team MediaPortal\MP2-Server\Plugins\SlimTv.Resources" and try?
    You can overwrite existing files, but I recommend to backup the previous versions beforehand.
     

    Attachments

    • SlimTv.Resources.rar
      38.1 KB

    Nordfinn

    MP Donator
  • Premium Supporter
  • January 18, 2014
    86
    8
    Home Country
    United States of America United States of America
    ge--
    Thanks much for your efforts. I've tried every which way, and I can't seem to get the files into the folder. Permissions problems. Tried unzipping in SlimTv.Resources, and also unzipping outside and then pasting in, etc. Owner of SlimTv.Resources is "System" and Administrator has full privileges. I'm not sure what's going on, but I don't deal with permissions issues very often.
     

    Nordfinn

    MP Donator
  • Premium Supporter
  • January 18, 2014
    86
    8
    Home Country
    United States of America United States of America
    ge-
    One other small thing: I'm assuming that there's no problem with case-sensitivity that I'm running into. Note that the options for "Channel logo style" are "Flat-default" and "Flat-local," whereas the logo folders in Program Data are named "Tv-Flat-Default" and "Tv-Flat-Local"
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,709
    3,492
    Stuttgart
    Home Country
    Germany Germany
    ge--
    Thanks much for your efforts. I've tried every which way, and I can't seem to get the files into the folder. Permissions problems. Tried unzipping in SlimTv.Resources, and also unzipping outside and then pasting in, etc. Owner of SlimTv.Resources is "System" and Administrator has full privileges. I'm not sure what's going on, but I don't deal with permissions issues very often.
    Did you stop the MP2-Server? This is also necessary. If still no access make yourself owner of the folder. Right mouse click on the folder, „security“-tab, "advanced", "edit" under owner, write your user name and confirm with OK.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,709
    3,492
    Stuttgart
    Home Country
    Germany Germany
    ge-
    One other small thing: I'm assuming that there's no problem with case-sensitivity that I'm running into. Note that the options for "Channel logo style" are "Flat-default" and "Flat-local," whereas the logo folders in Program Data are named "Tv-Flat-Default" and "Tv-Flat-Local"
    That shouldn’t be an issue.
     

    Nordfinn

    MP Donator
  • Premium Supporter
  • January 18, 2014
    86
    8
    Home Country
    United States of America United States of America
    Ok, thanks. Was able to copy into the folder once I stopped MP-2 Server. I'll report back as to whether your revised code solved the problem. Thanks much. N.
     

    Nordfinn

    MP Donator
  • Premium Supporter
  • January 18, 2014
    86
    8
    Home Country
    United States of America United States of America
    Ge: Your script appears to be working. Thanks very much for your efforts. I guess I have to wait 14 days, however, to be sure? N.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    theme.SkipOnlineUpdate
    Did you set this property to "true" inside the logo theme file? This is the intended way to prevent automatic online updates

    Edit:
    C#:
        /// <summary>
        /// Checks if the cached logo is still valid, if it is too old it will be re-downloaded. Logo themes
        /// can prevent this behavior by setting the <see cref="Theme.SkipOnlineUpdate"/> to <c>true</c>.
        /// </summary>
        /// <param name="theme">Current logo theme</param>
        /// <param name="logoFileName">Cached logo name</param>
        /// <returns><c>true</c> if logo exists and cache duration is valid</returns>

    And the SlimTvResource provider checks:
    C#:
            if (File.Exists(logoFileName) && IsCacheValid(theme, logoFileName))
              return BuildLogoResourceLocatorAndReturn(ref result, logoFileName);
    Which means: if the logo theme uses the "SkipOnlineUpdate=true" and a local image file is present, it will be returned to client without doing an online check/download/processing
     
    Last edited:

    Nordfinn

    MP Donator
  • Premium Supporter
  • January 18, 2014
    86
    8
    Home Country
    United States of America United States of America
    Ge--
    Yes, I did. Below are the last three lines of Flat-local.LOGOTHEME

    <ThemeName>Local</ThemeName>
    <SkipOnlineUpdate>true</SkipOnlineUpdate>
    </Theme>

    I also made sure to copy my logos to another place this time, as a safeguard.

    Thanks again. (And by the way, I've yet to figure out how to make a quote from a previous post, with the yellow sidebar, as above. I'm sure it must be obvious, but....).

    N.
     

    Users who are viewing this thread

    Top Bottom