TV4Home - WCF Webservice for MediaPortal TV Server (2 Viewers)

Oxan

Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Thanks, looks really good, especially the JSON interface, the WebVirtualCard class and the multi user setup.

    Regarding the CancelTimeShift problem: itt is that the StartTimeShifting() method changes the User object to pass to it: it adds a card and channel property. However, you don't save the changed User object, but just discard it and use the old User object when cancelling timeshifts. This patch fixes it (nicer would be to create a GetUserByUserName() which returns a reference, but I'm not that much into C# to do so):
    --- a/TV4Home/Server/TV4Home.Server.TVEInteractionLibrary/TVEInteraction.cs
    +++ b/TV4Home/Server/TV4Home.Server.TVEInteractionLibrary/TVEInteraction.cs
    @@ -371,8 +371,8 @@ namespace TV4Home.Server.TVEInteractionLibrary
    throw new NullReferenceException("Couldn't get virtual card.");

    // set card id and channel id of user, required for heartbeat and stopping of timeshifting
    - currentUser.CardId = tvCard.Id;
    - currentUser.IdChannel = channelId;
    + _tvUsers[userName].CardId = tvCard.Id;
    + _tvUsers[userName].IdChannel = channelId;

    return tvCard;
    }
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    Hi guys, thx for the updates, great stuff...

    Can we have a method for starting/stopping manual recordings?

    Also is there a way to get the error message when SwitchTVServerToChannelAndGetStreamingUrl or SwitchTVServerToChannelAndGetTimeshiftFilename failed?

    And the last stupid question for today: When do we need to call "SendHeartbeat(string userName)"?

    :D
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    @DJBlu

    Have you experienced any performance issues related to I/O operations or why do you think we should implement caching?

    I haven't tried this yet m8, I am mearly throwing in an idea.

    What I mean is,

    User A requests EPG for channel A, Channel A EPG is fetched and is cached in memory.
    User B requests EPG for channel A, EPG is fetched from cache.

    Requesting 879 Channels and EPG from the TV Database is taking a long time. If this is cached in memory on the web server then it will surely improve performance for all other clients.

    @DieBagger, It is up to the client what it does with the information, what my aim is, to improve server performance by reducing the number of SQL requests.

    You have many clients requesting All Channels and all EPG in a short space of time and it will eat up CPU time.

    Maybe the Web Server can cache this information on Start Up and refresh when the EPG is refreshed.
     

    akoeplinger

    Portal Member
    December 13, 2010
    15
    8
    Home Country
    Austria Austria
    The webservice uses a single thread for the request, so Gentle (the framework used by TVE to access the database) should cache the queries/results. There should be no need for us to implement caching directly in the webservice ;)
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    The webservice uses a single thread for the request, so Gentle (the framework used by TVE to access the database) should cache the queries/results. There should be no need for us to implement caching directly in the webservice ;)

    There is a serious fault then,

    There appears to be no caching here on my single seat. Changing from a large group to small group is less than one second but changing back to the large the mysql process has cpu usage and there is a pause of 3-4 seconds.
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    A few more requests if I may...

    These two I already discussed with mike lowrey but still:
    - ability to get tv logos and recording thumbnails through webservice
    - ability to download recordings with webservice (simple .net stream)

    And then there's one more, can you add a method to get base epg program for channels? I'm currently implementing the epg view for android and downloading the whole day for more then 10 channels takes forever (since the full details are transferred for each program).

    So instead (or in addition)

    public List<WebProgram> GetProgramsForChannel(int channelId, DateTime startTime, DateTime endTime)

    also

    public List<WebProgramBase> GetBaseProgramsForChannel(int channelId, DateTime startTime, DateTime endTime)

    :D
     

    Users who are viewing this thread

    Top Bottom