Plugin: MP2Extended (1 Viewer)

MrTechno

Retired Team Member
  • Premium Supporter
  • February 27, 2011
    1,256
    511
    London
    Home Country
    United Kingdom United Kingdom
    Media source importer is not working. I don't know if it's one particular file that's causing a problem or something I've done with the merge. Between that and the MIA rework problems @morpheus_xx is having and my work levels I don't have time to do anything at the moment. You could try pulling my branch into your repo and look at it?
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    I don't know if it's one particular file that's causing a problem or something I've done with the merge.
    I think it is caused by the merge. I pulled your branch and tried to import a Tv Show. It creates the MediaItems for the Show and the Seasons but not for the Episodes/Video Items.

    You could try pulling my branch into your repo and look at it?
    I will try. Just wanted to know if you are working on that already secretly or not. Just to avoid to do some work twice^^
     

    pünktchen

    Portal Pro
    October 26, 2010
    537
    201
    Home Country
    Germany Germany
    @MrTechno
    Any news on the merge? Can I help you somehow? Because my hands are kind of tied until this merge is done :( I implemented almost all non MIA related functions and need the rework to fix some of the issues and to implement the missing MAS functions especially for pictures and Music
    If you are bored :D i have some special wishes for some changes i've made to MPExtended for Emby
    that i'd like to see in MP2Extended also:
    Services/MPExtended.Services.TVAccessService/TVAccessService.cs
    Code:
    public WebBoolResult UnCancelSchedule(int programId)
    {
        try
        {
            Log.Debug("Uncancelling schedule for programId {0}", programId);
            var program = Program.Retrieve(programId);
            foreach (Schedule schedule in Schedule.ListAll().Where(schedule => schedule.IsSerieIsCanceled(program.StartTime, program.IdChannel)))
            {
                schedule.UnCancelSerie(program.StartTime, program.IdChannel);
                schedule.Persist();
            }
    
            return true;
        }
        catch (Exception ex)
        {
            Log.Warn(String.Format("Failed to uncancel schedule for programId {0}", programId), ex);
            return false;
        }
    }

    Services/MPExtended.Services.TVAccessService.Interfaces/ITVAccessService.cs
    Code:
    [OperationContract]
    [WebGet(ResponseFormat = WebMessageFormat.Json)]
    WebBoolResult UnCancelSchedule(int programId);

    Services/MPExtended.Services.StreamingService/StreamingService.cs
    Code:
    public Stream DoStream(WebMediaType type, int? provider, string itemId, string identifier, string clientDescription, string profileName, long startPosition, int? idleTimeout)
    {
        if (!IsClientAuthorized())
        {
            Log.Warn("Host {0} isn't authorized to call DoStream", WCFUtil.GetClientIPAddress());
            WCFUtil.SetResponseCode(HttpStatusCode.Unauthorized);
            return Stream.Null;
        }
    
        // calculate timeout, which is by default 5 minutes for direct streaming and 5 seconds for transcoded streams
        var profile = Configuration.StreamingProfiles.Transcoders.FirstOrDefault(x => x.Name == profileName);
        if(profile == null)
        {
            Log.Warn("Called DoStream with non-existing profile {0}", profileName);
            return Stream.Null;
        }
        int timeout = profile.Transcoder == typeof(Transcoders.Direct).FullName ? 5 * 60 : 5;
        if (idleTimeout.HasValue)
            timeout = idleTimeout.Value;
    
        // This only works with profiles that actually return something in the RetrieveStream method (i.e. no RTSP or CustomTranscoderData)
        StreamLog.Debug(identifier, "DoStream: using timeout={0}", timeout);
    
        if (!InitStream(type, provider, itemId, null, clientDescription, identifier, timeout))
        {
            StreamLog.Info(identifier, "DoStream: InitStream() failed");
            FinishStream(identifier);
            return Stream.Null;
        }
    
        if (String.IsNullOrEmpty(StartStream(identifier, profileName, startPosition)))
        {
            StreamLog.Info(identifier, "DoStream: StartStream failed");
            FinishStream(identifier);
            return Stream.Null;
        }
    
        StreamLog.Info(identifier, "DoStream: succeeded, returning stream");
        return RetrieveStream(identifier);
    }

     

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    And if you still are bored...:whistle: One thing that I miss a lot in MPExt is Online Videos support. I.e browse the sites and get item gfx and description. Then stream to device or play on HTPC.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    But than I need to change the API Version, or do you have something else in mind to make it obvious that this feature is available. :)
    Maybe in the GetVersion where it also lists TvSeries, MovingPictures etc... but I need to look into it.
     

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    Haha, that would be the smallest concern. I think the big work is to get it to actually work:)

    The service description request give all supported plugins and providers for MAS so why not adding it there. And you should probably increase version number of api anyway. Its already not the same as MPExt since some parts will always differ, e.g. Ids and upper/lower.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    @johanj
    Any special wishes for online Videos? How should the API look like? Any requirements? Just want to know so that I can build it to your requirements^^
    Today I've added "GetOnlineVideosSites". Right now it only returns Titles:
    [{"Id":null,"Title":"BR","PID":0},{"Id":null,"Title":"MDR","PID":0},{"Id":null,"Title":"NDR","PID":0},{"Id":null,"Title":"3sat","PID":0},{"Id":null,"Title":"mySpass","PID":0}, .... MANY MORE ...]

    I don't know how I should handle the fanart right now, but we will think about that once we are that far :D

    @pünktchen
    I haven't forgotten your request ;)
     

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    That sounds great!

    I'm not sure about the api requests right now. Normally I and Joost discuss the functionality and then Joost design, back to discussion, redesign... Usually it's a long process before we get to a final design where we know what features of the API we actually need. We haven't discussed any Online Videos design for MPiV yet but will do now.

    But I imagine that the api for this work similar to browsing folders or pictures. When in details view of a media item one want as much information as possible(description, title, season/episode, thumb, duration)

    I think I have more questions than answers :) Is it a server or client plugin in MP2?(I have only used it in MP1) E.g. the total number of sites are huge and one normally just select a few. Are these selected in the MP2Ext api or do one get the full list and need to do the selection at client side?

    We also need to think about what should happen when pressing play. Should it be selection of quality(if multiple are available) or should it auto select based on client settings? Should skipping of empty folder levels be done at client side or at the api, this based on Online Videos settings?

    So many of my questions are related to if you will honor the settings made in Online Videos configuration for the sites.

    This feature would actaully be the first real reason for me at some point move from MP1 to MP2
     
    Last edited:

    Users who are viewing this thread

    Top Bottom