How to read in mediaportal a value stored in tvlibrary? (1 Viewer)

bob987

MP Donator
  • Premium Supporter
  • January 25, 2009
    47
    5
    Home Country
    Israel Israel
    Hi,
    I will try to rewrite my original post so it will be a bit clearer (and hope to get an answer :))

    In short:
    I’ve added a new value inside the TV-Server configuration. Now I wish to read this value inside MediaPortal but I don’t know how.
    I searched for some example in the source code for the last days with out any luck.



    The full story:
    I’m living in Israel, and our weekdays are Sunday to Thursday, so I wish to change the advanced recording option of “Record Mon-Fri” to “Record Sun-Thu”.

    I managed to add a combo box to TV-Server Configuration (TvRecording,cs) that select the first working day. I store its value like all other values using:
    setting = layer.GetSetting("FirstWorkingDay", "0"); //default is Monday=0
    setting.Value = comboBoxFirstWorkingDay.SelectedIndex.ToString();
    setting.Persist();

    I can read this with no problem from inside the TvService (Scheduler.cs), using the layer.GetSetting.

    Now, I wish to change the text shown in MediPortal-> Advanced recording (option 6 & 7) according to the selected option in the TV-Server configuration.

    The problem is that I’m new to C#, and I didn’t find an example in the code of how to read this value.

    I did found in GUISettingsRecordings.cs an example of reading from the MediaPortal.xml the values of “prerecord” and “postrecord”. But I don’t see where the MediaPortal.xml value is set to the value stored from the TV server config.

    Could some one help me with how to export my “FirstWorkingDay” value from the tv server side to the mediaportal side?

    Thanks,
    bob
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    If you want to "export" a DB value from TV-Server versus MP, you have to look into TV-Plugin.

    If you want just to change the desription, look at strings_xx.xml, where xx si the country code, under languages directory.

    Simone
     

    Users who are viewing this thread

    Top Bottom