Beispiel #1
0
 public override Task UpdateAsync(UpdateParameter parameter)
 {
     var dao = new PeercastDao(Address);
     return dao.SetMetaAsync(parameter.Name, parameter.Genre, parameter.Description,
             parameter.ContactUrl, parameter.Comment,
             parameter.TrackArtist, parameter.TrackTitle, parameter.TrackAlbum,
             parameter.TrackGenre, parameter.TrackContact)
         .ContinueWith(t => dao.Dispose());
 }
 public override async Task UpdateAsync(UpdateParameter parameter)
 {
     using (var dao = new PeercastStationDao(Address))
     {
         await dao.SetChannelInfoAsync(parameter.Id,
             parameter.Name, parameter.ContactUrl, null, null, null,
             parameter.Genre, parameter.Description, parameter.Comment,
             parameter.TrackTitle, parameter.TrackArtist, parameter.TrackGenre,
             parameter.TrackAlbum, parameter.TrackContact);
     }
 }
 public abstract Task UpdateAsync(UpdateParameter parameter);
        public Task<Progressive.PecaStarter5.Plugins.UpdatedParameter> UpdateAsync(
            IPeercast peercast, IEnumerable<IExternalYellowPages> externalYellowPagesList,
            IYellowPages yellowPages, Dictionary<string, string> yellowPagesParameter,
            UpdateParameter parameter, IProgress<string> progress)
        {
            return Task.Factory.StartNew(() =>
            {
                // 更新
                progress.Report("通信中...");
                var param = (UpdateParameter)parameter.Clone();
                param.Genre = yellowPages.GetPrefix(yellowPagesParameter) + param.Genre;
                peercast.UpdateAsync(param).Wait();

                var updatedParameter = new Progressive.PecaStarter5.Plugins.UpdatedParameter
                {
                    YellowPagesParameters = yellowPagesParameter,
                    UpdateParameter = parameter
                };

                // 外部YPに通知
                if (yellowPages.IsExternal)
                {
                    Find(externalYellowPagesList, yellowPages.Name).OnUpdatedAsync(updatedParameter).Wait();
                }

                progress.Report("チャンネル情報を更新しました");
                return updatedParameter;
            });
        }