diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 06db1de74..10f9ec022 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -68,6 +68,7 @@ namespace MediaBrowser.Api _config.Configuration.EnableLocalizedGuids = true; _config.Configuration.EnableCustomPathSubFolders = true; _config.Configuration.EnableDateLastRefresh = true; + _config.Configuration.EnableStandaloneMusicKeys = true; _config.SaveConfiguration(); } diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 766f1e5ed..dc37dccea 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -153,6 +153,31 @@ namespace MediaBrowser.Controller.Entities.Audio /// System.String. protected override string CreateUserDataKey() { + if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys) + { + var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000") : string.Empty; + + + if (ParentIndexNumber.HasValue) + { + songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey; + } + songKey+= Name; + + if (!string.IsNullOrWhiteSpace(Album)) + { + songKey = Album + "-" + songKey; + } + + var albumArtist = AlbumArtists.FirstOrDefault(); + if (!string.IsNullOrWhiteSpace(albumArtist)) + { + songKey = albumArtist + "-" + songKey; + } + + return songKey; + } + var parent = AlbumEntity; if (parent != null) diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index c5ce6a2f7..e6178c183 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -34,7 +34,17 @@ namespace MediaBrowser.Controller.Entities.Audio { get { - return GetParents().OfType().FirstOrDefault(); + var artist = GetParents().OfType().FirstOrDefault(); + + if (artist == null) + { + var name = AlbumArtist; + if (!string.IsNullOrWhiteSpace(name)) + { + artist = LibraryManager.GetArtist(name); + } + } + return artist; } } @@ -106,6 +116,15 @@ namespace MediaBrowser.Controller.Entities.Audio return "MusicAlbum-Musicbrainz-" + id; } + if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys) + { + var albumArtist = AlbumArtist; + if (!string.IsNullOrWhiteSpace(albumArtist)) + { + return albumArtist + "-" + Name; + } + } + return base.CreateUserDataKey(); } @@ -125,7 +144,7 @@ namespace MediaBrowser.Controller.Entities.Audio id.AlbumArtists = AlbumArtists; - var artist = GetParents().OfType().FirstOrDefault(); + var artist = MusicArtist; if (artist != null) { diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 749d562ac..6f99e77ec 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; using CommonIO; @@ -85,6 +86,13 @@ namespace MediaBrowser.Controller.Entities.Movies /// The name of the TMDB collection. public string TmdbCollectionName { get; set; } + [IgnoreDataMember] + public string CollectionName + { + get { return TmdbCollectionName; } + set { TmdbCollectionName = value; } + } + /// /// Gets the trailer ids. /// diff --git a/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs index 0b434231f..1c1bbe71e 100644 --- a/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs @@ -35,7 +35,7 @@ namespace MediaBrowser.LocalMetadata.Parsers if (!string.IsNullOrWhiteSpace(val) && movie != null) { - movie.TmdbCollectionName = val; + movie.CollectionName = val; } break; diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 64edbdea9..009068dea 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -207,7 +207,8 @@ namespace MediaBrowser.Model.Configuration public bool DownloadImagesInAdvance { get; set; } public bool EnableAnonymousUsageReporting { get; set; } - + public bool EnableStandaloneMusicKeys { get; set; } + /// /// Initializes a new instance of the class. /// diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index ef2de5d78..8e3284152 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -206,12 +206,6 @@ namespace MediaBrowser.Model.Dto /// The short overview. public string ShortOverview { get; set; } - /// - /// Gets or sets the name of the TMDB collection. - /// - /// The name of the TMDB collection. - public string TmdbCollectionName { get; set; } - /// /// Gets or sets the taglines. /// diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index 78c683064..f92a0c6e2 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -35,6 +35,7 @@ namespace MediaBrowser.Model.LiveTv public string M3UUrl { get; set; } public string FriendlyName { get; set; } public int Tuners { get; set; } + public string DiseqC { get; set; } public int DataVersion { get; set; } diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 97fec8fdd..1540f178a 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -235,11 +235,6 @@ /// VoteCount, - /// - /// The TMDB collection name - /// - TmdbCollectionName, - /// /// The trailer url of the item /// diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index b0d3f6381..a83a40bc3 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -1022,8 +1022,8 @@ namespace MediaBrowser.Providers.Manager .ToList(); var musicArtists = albums - .Select(i => i.GetParent()) - .OfType() + .Select(i => i.MusicArtist) + .Where(i => i != null) .ToList(); var musicArtistRefreshTasks = musicArtists.Select(i => i.ValidateChildren(new Progress(), cancellationToken, options, true)); diff --git a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs index c98a67bbd..f9108b9fd 100644 --- a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs @@ -107,11 +107,21 @@ namespace MediaBrowser.Providers.MediaInfo private string GetAudioImagePath(Audio item) { - var album = item.AlbumEntity; - var filename = item.Album ?? string.Empty; filename += string.Join(",", item.Artists.ToArray()); - filename += album == null ? item.Id.ToString("N") + "_primary" + item.DateModified.Ticks : album.Id.ToString("N") + album.DateModified.Ticks + "_primary"; + + if (!string.IsNullOrWhiteSpace(item.Album)) + { + filename += "_" + item.Album; + } + else if (!string.IsNullOrWhiteSpace(item.Name)) + { + filename += "_" + item.Name; + } + else + { + filename += "_" + item.Id.ToString("N"); + } filename = filename.GetMD5() + ".jpg"; diff --git a/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs b/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs index abd4a6202..157704240 100644 --- a/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs +++ b/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs @@ -179,7 +179,7 @@ namespace MediaBrowser.Providers.Movies if (movieItem != null) { - movieItem.TmdbCollectionName = movieData.belongs_to_collection.name; + movieItem.CollectionName = movieData.belongs_to_collection.name; } } diff --git a/MediaBrowser.Providers/Movies/MovieMetadataService.cs b/MediaBrowser.Providers/Movies/MovieMetadataService.cs index 8757bdd0d..f4cad837a 100644 --- a/MediaBrowser.Providers/Movies/MovieMetadataService.cs +++ b/MediaBrowser.Providers/Movies/MovieMetadataService.cs @@ -37,9 +37,9 @@ namespace MediaBrowser.Providers.Movies var sourceItem = source.Item; var targetItem = target.Item; - if (replaceData || string.IsNullOrEmpty(targetItem.TmdbCollectionName)) + if (replaceData || string.IsNullOrEmpty(targetItem.CollectionName)) { - targetItem.TmdbCollectionName = sourceItem.TmdbCollectionName; + targetItem.CollectionName = sourceItem.CollectionName; } } } diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index a19a122c3..fb202b798 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -1378,16 +1378,6 @@ namespace MediaBrowser.Server.Implementations.Dto } } - // Add MovieInfo - var movie = item as Movie; - if (movie != null) - { - if (fields.Contains(ItemFields.TmdbCollectionName)) - { - dto.TmdbCollectionName = movie.TmdbCollectionName; - } - } - var hasSpecialFeatures = item as IHasSpecialFeatures; if (hasSpecialFeatures != null) { diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 721603efe..3c56af9e6 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1044,11 +1044,6 @@ namespace MediaBrowser.Server.Implementations.Library return names; } - private void SetPropertiesFromSongs(MusicArtist artist, IEnumerable items) - { - - } - /// /// Validate and refresh the People sub-set of the IBN. /// The items are stored in the db but not loaded into memory until actually requested by an operation. diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs index 9a02413cd..19b91a34f 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs @@ -90,6 +90,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp if (existing == null) { + if (string.IsNullOrWhiteSpace(info.M3UUrl)) + { + return; + } + await _liveTvManager.SaveTunerHost(new TunerHostInfo { Type = SatIpHost.DeviceType, @@ -97,7 +102,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp DataVersion = 1, DeviceId = info.DeviceId, FriendlyName = info.FriendlyName, - Tuners = info.Tuners + Tuners = info.Tuners, + M3UUrl = info.M3UUrl, + IsEnabled = true }).ConfigureAwait(false); } diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs index 7362ee58f..cb74d4dd7 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs @@ -180,7 +180,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers } catch (XmlException) { - + } } } @@ -661,7 +661,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers if (!string.IsNullOrWhiteSpace(val)) { val = val.Replace("plugin://plugin.video.youtube/?action=play_video&videoid=", "http://www.youtube.com/watch?v=", StringComparison.OrdinalIgnoreCase); - + hasTrailer.AddTrailerUrl(val, false); } } @@ -860,6 +860,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers break; case "collectionnumber": + case "tmdbcolid": var tmdbCollection = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(tmdbCollection)) { diff --git a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs index 8d5c2bf20..14c214f04 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs @@ -11,7 +11,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers { class MovieNfoParser : BaseNfoParser