Git Product home page Git Product logo

Comments (4)

mcaptur avatar mcaptur commented on May 20, 2024

this patch should fix it

diff --git a/pvr.filmon/resources/language/resource.language.en_gb/strings.po b/pvr.filmon/resources/language/resource.language.en_gb/strings.po
index d282de7..a570dbb 100644
--- a/pvr.filmon/resources/language/resource.language.en_gb/strings.po
+++ b/pvr.filmon/resources/language/resource.language.en_gb/strings.po
@@ -23,3 +23,9 @@ msgstr ""
msgctxt "#30001"
msgid "Password"
msgstr ""
+
+msgctxt "#30002"
+msgid "Prefer HD"
+msgstr ""
+
+
diff --git a/pvr.filmon/resources/settings.xml b/pvr.filmon/resources/settings.xml
index d104352..4fede35 100644
--- a/pvr.filmon/resources/settings.xml
+++ b/pvr.filmon/resources/settings.xml
@@ -2,4 +2,5 @@



-
\ No newline at end of file

+
diff --git a/src/FilmonAPI.cpp b/src/FilmonAPI.cpp
index 76c87bc..dac1fda 100644
--- a/src/FilmonAPI.cpp
+++ b/src/FilmonAPI.cpp
@@ -44,11 +44,14 @@
#define TIMER_STATUS "Accepted"
#define OFF_AIR "Off Air"

/* open without caching. regardless to file type. */
#define READ_NO_CACHE 0x08

using namespace ADDON;

// Attempt at genres
typedef struct {
int genreType;
@@ -343,14 +346,32 @@ bool filmonAPIgetChannel(unsigned int channelId, FILMON_CHANNEL *channel) {
std::string streamURL;
unsigned int streamCount = streams.size();
unsigned int stream = 0;

  •   bool Pref_HD =true;
    
  • for (stream = 0; stream < streamCount; stream++) {
        std::string quality = streams[stream]["quality"].asString();
    
  •       if (quality.compare(std::string("high")) == 0 || quality.compare(std::string("480p")) == 0 || quality.compare(std::string("HD")) == 0) {
    
  •           XBMC->Log(LOG_DEBUG, "high quality stream found: %s", quality.c_str());
    
  •           break;
    
  •       } else {
    
  •           XBMC->Log(LOG_DEBUG, "low quality stream found: %s", quality.c_str());
    
  •       if (XBMC->GetSetting("preferhd",&Pref_HD)){
    
  •           XBMC->Log(LOG_DEBUG, "Prefer high quality stream");
    
  •           if (quality.compare(std::string("high")) == 0 || quality.compare(std::string("480p")) == 0 || quality.compare(std::string("HD")) == 0) {
    
  •               XBMC->Log(LOG_DEBUG, "high quality stream found: %s", quality.c_str());
    
  •               break;
    
  •           } else {
    
  •               XBMC->Log(LOG_DEBUG, "low quality stream found: %s", quality.c_str());
    
  •           }
    
  •       }
    
  •       else{
    
  •           XBMC->Log(LOG_DEBUG, "Prefer low quality stream");
    
  •           if (quality.compare(std::string("high")) == 0 || quality.compare(std::string("480p")) == 0 || quality.compare(std::string("HD")) == 0) {
    
  •                               XBMC->Log(LOG_DEBUG, "high quality stream found: %s", quality.c_str());
    
  •                           } else {
    
  •                               XBMC->Log(LOG_DEBUG, "low quality stream found: %s", quality.c_str());
    
  •                               break;
    
  •                       }
        }
    
    • }
      std::string chTitle = title.asString();
      std::string iconPath = icon.asString();
      diff --git a/src/client.cpp b/src/client.cpp
      index 427c0cb..a124560 100644
      --- a/src/client.cpp
      +++ b/src/client.cpp
      @@ -48,6 +48,7 @@ std::string g_strUserPath = "";
      std::string g_strClientPath = "";
      std::string g_strUsername = "";
      std::string g_strPassword = "";
      +bool g_boolPreferHd = true;

    CHelper_libXBMC_addon *XBMC = NULL;
    CHelper_libXBMC_pvr *PVR = NULL;
    @@ -56,6 +57,7 @@ extern "C" {

    void ADDON_ReadSettings(void) {
    char buffer[1024] = "";

  • bool Pref_HD =true;

/* read setting "username" from settings.xml */
if (XBMC->GetSetting("username", buffer))
@@ -70,6 +72,13 @@ void ADDON_ReadSettings(void) {
else
g_strPassword = "";

  • /* read setting "preferhd" from settings.xml */
  • if (XBMC->GetSetting("preferhd", &Pref_HD))
  •   g_boolPreferHd = true;
    
  • else
  •   g_boolPreferHd = false;
    
    XBMC->Log(LOG_DEBUG, "%s - read PVR Filmon settings", FUNCTION);
    }

@@ -132,29 +141,49 @@ unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) {
return 0;
}

-ADDON_STATUS ADDON_SetSetting(const char *settingName,

  •   const void *settingValue) {
    
  • string str = settingName;
  • if (str == "username") {
  •   string tmp_sUsername = g_strUsername;
    
  •   g_strUsername = (const char*) settingValue;
    
  •   if (tmp_sUsername != g_strUsername) {
    
  •       XBMC->Log(LOG_INFO, "%s - Changed Setting 'username'",
    
  •               **FUNCTION**);
    
  •       return ADDON_STATUS_NEED_RESTART;
    
  •   }
    
  • } else if (str == "password") {
  •   string tmp_sPassword = g_strPassword;
    
  •   g_strPassword = (const char*) settingValue;
    
  •   if (tmp_sPassword != g_strPassword) {
    
  •       XBMC->Log(LOG_INFO, "%s - Changed Setting 'password'",
    
  •               **FUNCTION**);
    
  •       return ADDON_STATUS_NEED_RESTART;
    
  •   }
    
  • }
  • return ADDON_STATUS_OK;

+ADDON_STATUS ADDON_SetSetting

  • (const char *settingName, const void *settingValue)
    +{
    +#define UPDATE_STR(key, var)\
  • if (!strcmp(settingName, key))\
  • {\
  • if (strcmp(var.c_str(), (const char*)settingValue) != 0)\
  • {\
  •   XBMC->Log(LOG_INFO, "%s - Changed Setting",\
    
  •               **FUNCTION**);\
    
  •       return ADDON_STATUS_NEED_RESTART;\
    
  • }\
  • return ADDON_STATUS_OK;\
  • }

+#define UPDATE_INT(key, type, var)\

  • if (!strcmp(settingName, key))\
  • {\
  • if (var != (type)settingValue)\
  • {\
  •   XBMC->Log(LOG_INFO, "%s - Changed Setting",\
    
  •               **FUNCTION**);\
    
  •       return ADDON_STATUS_NEED_RESTART;\
    
  • }\
  • return ADDON_STATUS_OK;\
  • }
  • /* Connection */
  • UPDATE_STR("username", g_strUsername);
  • UPDATE_STR("password", g_strPassword);
  • /* HD */
  • UPDATE_INT("preferhd", bool, g_boolPreferHd);
  • return ADDON_STATUS_OK;

+#undef UPDATE_INT
+#undef UPDATE_STR
}

void ADDON_Stop() {
}

from pvr.filmon.

Mike-KL avatar Mike-KL commented on May 20, 2024

Assume this was/is fixed as option within add-on settings for enabling HD which is disabled on initial installation of add-on and addition of user film-on login details. To be closed?

from pvr.filmon.

Jalle19 avatar Jalle19 commented on May 20, 2024

Looks like this can be closed indeed.

from pvr.filmon.

mcaptur avatar mcaptur commented on May 20, 2024

yep

from pvr.filmon.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.