public async Task <ICollection <Guid> > GetAllManagedMediaItemAspectTypesAsync()
        {
            CpAction       action        = GetAction("X_MediaPortal_GetAllManagedMediaItemAspectTypes");
            IList <object> inParameters  = new List <object>();
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            string miaTypeIDs = (string)outParameters[0];

            return(miaTypeIDs.Split(',').Select(MarshallingHelper.DeserializeGuid).ToList());
        }
Exemplo n.º 2
0
        public Share GetShare(Guid shareId)
        {
            CpAction       action       = GetAction("X_MediaPortal_GetShare");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(shareId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((Share)outParameters[0]);
        }
Exemplo n.º 3
0
        public MediaItemAspectMetadata GetMediaItemAspectMetadata(Guid miamId)
        {
            CpAction       action       = GetAction("X_MediaPortal_GetMediaItemAspectMetadata");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(miamId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((MediaItemAspectMetadata)outParameters[0]);
        }
Exemplo n.º 4
0
        public string GetResourcePathDisplayName(ResourcePath path)
        {
            CpAction       action       = GetAction("GetResourcePathDisplayName");
            IList <object> inParameters = new List <object> {
                path.Serialize()
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((string)outParameters[0]);
        }
        public async Task <Guid> CreateClientProfileAsync(Guid profileId, string profileName)
        {
            CpAction       action       = GetAction("CreateClientProfile");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId), profileName
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return(MarshallingHelper.DeserializeGuid((string)outParameters[0]));
        }
Exemplo n.º 6
0
        public bool DoesResourceProviderSupportTreeListing(Guid resourceProviderId)
        {
            CpAction       action       = GetAction("DoesResourceProviderSupportTreeListing");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(resourceProviderId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((bool)outParameters[0]);
        }
Exemplo n.º 7
0
        public ResourcePath ConcatenatePaths(ResourcePath basePath, string relativePath)
        {
            CpAction       action       = GetAction("ConcatenatePaths");
            IList <object> inParameters = new List <object> {
                basePath.Serialize(), relativePath
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return(ResourcePath.Deserialize((string)outParameters[0]));
        }
        public async Task <bool> SetProfileImageAsync(Guid profileId, byte[] profileImage)
        {
            CpAction       action       = GetAction("SetProfileImage");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId), profileImage != null && profileImage.Length > 0 ? Convert.ToBase64String(profileImage) : ""
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
        public async Task <bool> RenameProfileAsync(Guid profileId, string newName)
        {
            CpAction       action       = GetAction("RenameProfile");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId), newName
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
        public async Task <Guid> CreateProfileAsync(string profileName, UserProfileType profileType, string profilePassword)
        {
            CpAction       action       = GetAction("CreateUserProfile");
            IList <object> inParameters = new List <object> {
                profileName, (int)profileType, profilePassword
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return(MarshallingHelper.DeserializeGuid((string)outParameters[0]));
        }
        public async Task <bool> UpdateProfileAsync(Guid profileId, string profileName, UserProfileType profileType, string profilePassword)
        {
            CpAction       action       = GetAction("UpdateUserProfile");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId), profileName, (int)profileType, profilePassword
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
Exemplo n.º 12
0
        public bool DeletePlaylist(Guid playlistId)
        {
            CpAction       action       = GetAction("DeletePlaylist");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(playlistId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((bool)outParameters[0]);
        }
 public async Task NotifyPlaybackAsync(Guid mediaItemId, bool watched)
 {
     CpAction       action       = GetAction("X_MediaPortal_NotifyPlayback");
     IList <object> inParameters = new List <object>
     {
         MarshallingHelper.SerializeGuid(mediaItemId),
         watched
     };
     await action.InvokeAsync(inParameters);
 }
        public async Task <bool> DeletePlaylistAsync(Guid playlistId)
        {
            CpAction       action       = GetAction("X_MediaPortal_DeletePlaylist");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(playlistId)
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
Exemplo n.º 15
0
        public ICollection <ResourcePathMetadata> GetFilesData(ResourcePath path)
        {
            CpAction       action       = GetAction("GetFilesData");
            IList <object> inParameters = new List <object> {
                path.Serialize()
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((ICollection <ResourcePathMetadata>)outParameters[0]);
        }
        public async Task <bool> ChangeProfileIdAsync(Guid profileId, Guid newProfileId)
        {
            CpAction       action       = GetAction("ChangeProfileId");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId), MarshallingHelper.SerializeGuid(newProfileId)
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
Exemplo n.º 17
0
        public bool DoesResourceExist(ResourcePath path)
        {
            CpAction       action       = GetAction("DoesResourceExist");
            IList <object> inParameters = new List <object> {
                path.Serialize()
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((bool)outParameters[0]);
        }
        public async Task <bool> ClearAllUserDataAsync(Guid profileId)
        {
            CpAction       action       = GetAction("ClearAllUserData");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId)
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
Exemplo n.º 19
0
        public ResourcePath ExpandResourcePathFromString(Guid resourceProviderId, string path)
        {
            CpAction       action       = GetAction("ExpandResourcePathFromString");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(resourceProviderId), path
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return(ResourcePath.Deserialize((string)outParameters[0]));
        }
        public async Task <bool> ClearUserAdditionalDataKeyAsync(Guid profileId, string key)
        {
            CpAction       action       = GetAction("ClearUserAdditionalDataKey");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId), key
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            return((bool)outParameters[0]);
        }
Exemplo n.º 21
0
        public ResourceProviderMetadata GetResourceProviderMetadata(Guid resourceProviderId)
        {
            CpAction       action       = GetAction("GetResourceProviderMetadata");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(resourceProviderId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((ResourceProviderMetadata)outParameters[0]);
        }
Exemplo n.º 22
0
        public PlaylistRawData ExportPlaylist(Guid playlistId)
        {
            CpAction       action       = GetAction("X_MediaPortal_ExportPlaylist");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(playlistId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((PlaylistRawData)outParameters[0]);
        }
        public Guid CreateProfile(string profileName)
        {
            CpAction       action       = GetAction("CreateProfile");
            IList <object> inParameters = new List <object> {
                profileName
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return(MarshallingHelper.DeserializeGuid((string)outParameters[0]));
        }
Exemplo n.º 24
0
        public bool GetProfileByName(string profileName, out UserProfile userProfile)
        {
            CpAction       action       = GetAction("GetProfileByName");
            IList <object> inParameters = new List <object> {
                profileName
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            userProfile = (UserProfile)outParameters[0];
            return(userProfile != null);
        }
Exemplo n.º 25
0
        public bool GetProfile(Guid profileId, out UserProfile userProfile)
        {
            CpAction       action       = GetAction("GetProfile");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId)
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            userProfile = (UserProfile)outParameters[0];
            return(userProfile != null);
        }
        public int CountMediaItems(IEnumerable <Guid> necessaryMIATypes, IFilter filter, bool onlyOnline)
        {
            CpAction       action         = GetAction("CountMediaItems");
            string         onlineStateStr = SerializeOnlineState(onlyOnline);
            IList <object> inParameters   = new List <object> {
                MarshallingHelper.SerializeGuidEnumerationToCsv(necessaryMIATypes), filter, onlineStateStr
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((int)outParameters[0]);
        }
        public IList <MediaItem> Search(MediaItemQuery query, bool onlyOnline)
        {
            CpAction       action         = GetAction("Search");
            String         onlineStateStr = SerializeOnlineState(onlyOnline);
            IList <object> inParameters   = new List <object> {
                query, onlineStateStr
            };
            IList <object> outParameters = action.InvokeAction(inParameters);

            return((IList <MediaItem>)outParameters[0]);
        }
 public async Task<MediaItem> LoadItemAsync(string systemId, Guid mediaItemId,
     IEnumerable<Guid> necessaryMIATypes, IEnumerable<Guid> optionalMIATypes, Guid? userProfile)
 {
   CpAction action = GetAction("X_MediaPortal_LoadItemId");
   IList<object> inParameters = new List<object> {systemId, MarshallingHelper.SerializeGuid(mediaItemId),
       MarshallingHelper.SerializeGuidEnumerationToCsv(necessaryMIATypes),
       MarshallingHelper.SerializeGuidEnumerationToCsv(optionalMIATypes),
       userProfile.HasValue ? MarshallingHelper.SerializeGuid(userProfile.Value) : null };
   IList<object> outParameters = await action.InvokeAsync(inParameters);
   return (MediaItem)outParameters[0];
 }
Exemplo n.º 29
0
        public async Task <AsyncResult <UserProfile> > GetProfileByNameAsync(string profileName)
        {
            CpAction       action       = GetAction("GetProfileByName");
            IList <object> inParameters = new List <object> {
                profileName
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            var userProfile = (UserProfile)outParameters[0];

            return(new AsyncResult <UserProfile>(userProfile != null, userProfile));
        }
Exemplo n.º 30
0
        public async Task <AsyncResult <UserProfile> > GetProfileAsync(Guid profileId)
        {
            CpAction       action       = GetAction("GetProfile");
            IList <object> inParameters = new List <object> {
                MarshallingHelper.SerializeGuid(profileId)
            };
            IList <object> outParameters = await action.InvokeAsync(inParameters);

            var userProfile = (UserProfile)outParameters[0];

            return(new AsyncResult <UserProfile>(userProfile != null, userProfile));
        }