This commit is contained in:
Michalis Adamidis
2014-08-06 21:06:34 +02:00
75 changed files with 689 additions and 201 deletions

View File

@@ -112,6 +112,8 @@ namespace MediaBrowser.Server.Implementations.Dto
var dto = new BaseItemDto();
dto.SupportsPlaylists = item.SupportsAddingToPlaylist;
if (fields.Contains(ItemFields.People))
{
AttachPeople(dto, item);
@@ -849,17 +851,7 @@ namespace MediaBrowser.Server.Implementations.Dto
if (fields.Contains(ItemFields.Overview))
{
// TODO: Remove this after a while, since it's been moved to the providers
if (item is MusicArtist)
{
var strippedOverview = string.IsNullOrEmpty(item.Overview) ? item.Overview : item.Overview.StripHtml();
dto.Overview = strippedOverview;
}
else
{
dto.Overview = item.Overview;
}
dto.Overview = item.Overview;
}
if (fields.Contains(ItemFields.ShortOverview))

View File

@@ -12,7 +12,6 @@ using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
@@ -551,24 +550,28 @@ namespace MediaBrowser.Server.Implementations.LiveTv
};
}
if (!string.IsNullOrEmpty(info.Path))
{
item.Path = info.Path;
}
else if (!string.IsNullOrEmpty(info.Url))
{
item.Path = info.Url;
}
isNew = true;
}
item.RecordingInfo = info;
item.ServiceName = serviceName;
var originalPath = item.Path;
if (!string.IsNullOrEmpty(info.Path))
{
item.Path = info.Path;
}
else if (!string.IsNullOrEmpty(info.Url))
{
item.Path = info.Url;
}
var pathChanged = !string.Equals(originalPath, item.Path);
await item.RefreshMetadata(new MetadataRefreshOptions
{
ForceSave = isNew
ForceSave = isNew || pathChanged
}, cancellationToken);

View File

@@ -334,5 +334,6 @@
"OptionNewPlaylist": "New playlist...",
"MessageAddedToPlaylistSuccess": "Ok",
"ButtonViewSeriesRecording": "View series recording",
"ValueOriginalAirDate": "Original air date: {0}"
"ValueOriginalAirDate": "Original air date: {0}",
"ButtonRemoveFromPlaylist": "Remove from playlist"
}

View File

@@ -190,9 +190,29 @@ namespace MediaBrowser.Server.Implementations.Playlists
}, CancellationToken.None).ConfigureAwait(false);
}
public Task RemoveFromPlaylist(string playlistId, IEnumerable<int> indeces)
public async Task RemoveFromPlaylist(string playlistId, IEnumerable<string> entryIds)
{
throw new NotImplementedException();
var playlist = _libraryManager.GetItemById(playlistId) as Playlist;
if (playlist == null)
{
throw new ArgumentException("No Playlist exists with the supplied Id");
}
var children = playlist.LinkedChildren.ToList();
var idList = entryIds.ToList();
var removals = children.Where(i => idList.Contains(i.Id));
playlist.LinkedChildren = children.Except(removals)
.ToList();
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
await playlist.RefreshMetadata(new MetadataRefreshOptions
{
ForceSave = true
}, CancellationToken.None).ConfigureAwait(false);
}
public Folder GetPlaylistsFolder(string userId)

View File

@@ -124,7 +124,7 @@ namespace MediaBrowser.Server.Implementations.Udp
{
Address = serverAddress,
Id = _appHost.ServerId,
Name = _appHost.Name
Name = _appHost.FriendlyName
};
await SendAsync(Encoding.UTF8.GetBytes(_json.SerializeToString(response)), endpoint);