diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-05-06 15:58:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-06 15:58:38 -0400 |
| commit | e42ef5c1817fb500b14c2eac4aa0ed765a6c6e64 (patch) | |
| tree | 6beddce4dffa97eb199da99867f6b493ce197e64 /Emby.Server.Implementations | |
| parent | b0dd8c1b7542e0a7c0d58fa5bdca4e69ca174746 (diff) | |
| parent | 4764e3924773546d8db8c805d05990bbbfe44a7e (diff) | |
Merge pull request #2615 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations')
5 files changed, 36 insertions, 189 deletions
diff --git a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs index 0096f2284..e25955782 100644 --- a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs +++ b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs @@ -71,10 +71,9 @@ namespace Emby.Server.Implementations.Data double newPercentCommplete = 45 + .55 * p; progress.Report(newPercentCommplete); }); - await CleanDeletedItems(cancellationToken, innerProgress).ConfigureAwait(false); - progress.Report(100); await _itemRepo.UpdateInheritedValues(cancellationToken).ConfigureAwait(false); + progress.Report(100); } private async Task CleanDeadItems(CancellationToken cancellationToken, IProgress<double> progress) @@ -115,115 +114,6 @@ namespace Emby.Server.Implementations.Data progress.Report(100); } - private async Task CleanDeletedItems(CancellationToken cancellationToken, IProgress<double> progress) - { - var result = _itemRepo.GetItemIdsWithPath(new InternalItemsQuery - { - LocationTypes = new[] { LocationType.FileSystem }, - //Limit = limit, - - // These have their own cleanup routines - ExcludeItemTypes = new[] - { - typeof(Person).Name, - typeof(Genre).Name, - typeof(MusicGenre).Name, - typeof(GameGenre).Name, - typeof(Studio).Name, - typeof(Year).Name, - typeof(Channel).Name, - typeof(AggregateFolder).Name, - typeof(CollectionFolder).Name - } - }); - - var numComplete = 0; - var numItems = result.Count; - - var allLibraryPaths = _libraryManager - .GetVirtualFolders() - .SelectMany(i => i.Locations) - .ToList(); - - foreach (var item in result) - { - cancellationToken.ThrowIfCancellationRequested(); - - var path = item.Item2; - - try - { - var isPathInLibrary = false; - - if (allLibraryPaths.Any(i => path.StartsWith(i, StringComparison.Ordinal)) || - allLibraryPaths.Contains(path, StringComparer.Ordinal) || - path.StartsWith(_appPaths.ProgramDataPath, StringComparison.Ordinal)) - { - isPathInLibrary = true; - - if (_fileSystem.FileExists(path) || _fileSystem.DirectoryExists(path)) - { - continue; - } - } - - var libraryItem = _libraryManager.GetItemById(item.Item1); - - if (libraryItem == null) - { - continue; - } - - if (libraryItem.IsTopParent) - { - continue; - } - - var hasDualAccess = libraryItem as IHasDualAccess; - if (hasDualAccess != null && hasDualAccess.IsAccessedByName) - { - continue; - } - - var libraryItemPath = libraryItem.Path; - if (!string.Equals(libraryItemPath, path, StringComparison.OrdinalIgnoreCase)) - { - _logger.Error("CleanDeletedItems aborting delete for item {0}-{1} because paths don't match. {2}---{3}", libraryItem.Id, libraryItem.Name, libraryItem.Path ?? string.Empty, path ?? string.Empty); - continue; - } - - if (Folder.IsPathOffline(path, allLibraryPaths)) - { - continue; - } - - if (isPathInLibrary) - { - _logger.Info("Deleting item from database {0} because path no longer exists. type: {1} path: {2}", libraryItem.Name, libraryItem.GetType().Name, libraryItemPath ?? string.Empty); - } - else - { - _logger.Info("Deleting item from database {0} because path is no longer in the server library. type: {1} path: {2}", libraryItem.Name, libraryItem.GetType().Name, libraryItemPath ?? string.Empty); - } - - await libraryItem.OnFileDeleted().ConfigureAwait(false); - } - catch (OperationCanceledException) - { - throw; - } - catch (Exception ex) - { - _logger.ErrorException("Error in CleanDeletedItems. File {0}", ex, path); - } - - numComplete++; - double percent = numComplete; - percent /= numItems; - progress.Report(percent * 100); - } - } - /// <summary> /// Creates the triggers that define when the task will run /// </summary> diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 272d79e48..61dce9bba 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -201,7 +201,6 @@ namespace Emby.Server.Implementations.Data AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames); - AddColumn(db, "TypedBaseItems", "OfficialRatingDescription", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "HomePageUrl", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "VoteCount", "INT", existingColumnNames); AddColumn(db, "TypedBaseItems", "DisplayMediaType", "Text", existingColumnNames); @@ -209,7 +208,6 @@ namespace Emby.Server.Implementations.Data AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames); AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames); - AddColumn(db, "TypedBaseItems", "LocationType", "Text", existingColumnNames); AddColumn(db, "TypedBaseItems", "IsSeries", "BIT", existingColumnNames); AddColumn(db, "TypedBaseItems", "IsLive", "BIT", existingColumnNames); @@ -427,7 +425,6 @@ namespace Emby.Server.Implementations.Data "ParentIndexNumber", "ProductionYear", "OfficialRating", - "OfficialRatingDescription", "HomePageUrl", "DisplayMediaType", "ForcedSortName", @@ -548,14 +545,12 @@ namespace Emby.Server.Implementations.Data "InheritedParentalRatingValue", "SortName", "RunTimeTicks", - "OfficialRatingDescription", "HomePageUrl", "VoteCount", "DisplayMediaType", "DateCreated", "DateModified", "ForcedSortName", - "LocationType", "PreferredMetadataLanguage", "PreferredMetadataCountryCode", "IsHD", @@ -827,7 +822,6 @@ namespace Emby.Server.Implementations.Data saveItemStatement.TryBind("@SortName", item.SortName); saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks); - saveItemStatement.TryBind("@OfficialRatingDescription", item.OfficialRatingDescription); saveItemStatement.TryBind("@HomePageUrl", item.HomePageUrl); saveItemStatement.TryBind("@VoteCount", item.VoteCount); saveItemStatement.TryBind("@DisplayMediaType", item.DisplayMediaType); @@ -835,7 +829,6 @@ namespace Emby.Server.Implementations.Data saveItemStatement.TryBind("@DateModified", item.DateModified); saveItemStatement.TryBind("@ForcedSortName", item.ForcedSortName); - saveItemStatement.TryBind("@LocationType", item.LocationType.ToString()); saveItemStatement.TryBind("@PreferredMetadataLanguage", item.PreferredMetadataLanguage); saveItemStatement.TryBind("@PreferredMetadataCountryCode", item.PreferredMetadataCountryCode); @@ -1281,22 +1274,10 @@ namespace Emby.Server.Implementations.Data { return false; } - if (type == typeof(Year)) - { - return false; - } - if (type == typeof(Book)) - { - return false; - } if (type == typeof(Person)) { return false; } - if (type == typeof(RecordingGroup)) - { - return false; - } if (type == typeof(Channel)) { return false; @@ -1330,31 +1311,42 @@ namespace Emby.Server.Implementations.Data return false; } } - if (_config.Configuration.SkipDeserializationForPrograms) + + if (type == typeof(Year)) { - if (type == typeof(LiveTvProgram)) - { - return false; - } + return false; + } + if (type == typeof(Book)) + { + return false; + } + if (type == typeof(RecordingGroup)) + { + return false; + } + if (type == typeof(LiveTvProgram)) + { + return false; + } + if (type == typeof(LiveTvAudioRecording)) + { + return false; + } + if (type == typeof(AudioPodcast)) + { + return false; + } + if (type == typeof(AudioBook)) + { + return false; } + if (_config.Configuration.SkipDeserializationForAudio) { if (type == typeof(Audio)) { return false; } - if (type == typeof(LiveTvAudioRecording)) - { - return false; - } - if (type == typeof(AudioPodcast)) - { - return false; - } - if (type == typeof(AudioBook)) - { - return false; - } if (type == typeof(MusicAlbum)) { return false; @@ -1600,15 +1592,6 @@ namespace Emby.Server.Implementations.Data } index++; - if (query.HasField(ItemFields.OfficialRatingDescription)) - { - if (!reader.IsDBNull(index)) - { - item.OfficialRatingDescription = reader.GetString(index); - } - index++; - } - if (query.HasField(ItemFields.HomePageUrl)) { if (!reader.IsDBNull(index)) @@ -4077,27 +4060,6 @@ namespace Emby.Server.Implementations.Data whereClauses.Add("ProductionYear in (" + val + ")"); } - if (query.LocationTypes.Length == 1) - { - if (query.LocationTypes[0] == LocationType.Virtual && _config.Configuration.SchemaVersion >= 90) - { - query.IsVirtualItem = true; - } - else - { - whereClauses.Add("LocationType=@LocationType"); - if (statement != null) - { - statement.TryBind("@LocationType", query.LocationTypes[0].ToString()); - } - } - } - else if (query.LocationTypes.Length > 1) - { - var val = string.Join(",", query.LocationTypes.Select(i => "'" + i + "'").ToArray()); - - whereClauses.Add("LocationType in (" + val + ")"); - } if (query.IsVirtualItem.HasValue) { whereClauses.Add("IsVirtualItem=@IsVirtualItem"); diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.cs index 51c9504c2..f640ae2b1 100644 --- a/Emby.Server.Implementations/Library/SearchEngine.cs +++ b/Emby.Server.Implementations/Library/SearchEngine.cs @@ -168,7 +168,13 @@ namespace Emby.Server.Implementations.Library IncludeItemsByName = string.IsNullOrWhiteSpace(query.ParentId), ParentId = string.IsNullOrWhiteSpace(query.ParentId) ? (Guid?)null : new Guid(query.ParentId), SortBy = new[] { ItemSortBy.SortName }, - Recursive = true + Recursive = true, + + IsKids = query.IsKids, + IsMovie = query.IsMovie, + IsNews = query.IsNews, + IsSeries = query.IsSeries, + IsSports = query.IsSports }); // Add search hints based on item name diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 9ce482273..f1b3f41b4 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -2155,11 +2155,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV writer.WriteElementString("mpaa", item.OfficialRating); } - if (!string.IsNullOrEmpty(item.OfficialRatingDescription)) - { - writer.WriteElementString("mpaadescription", item.OfficialRatingDescription); - } - var overview = (item.Overview ?? string.Empty) .StripHtml() .Replace(""", "'"); diff --git a/Emby.Server.Implementations/Security/PluginSecurityManager.cs b/Emby.Server.Implementations/Security/PluginSecurityManager.cs index 7cd0a8d5f..d42fae3ad 100644 --- a/Emby.Server.Implementations/Security/PluginSecurityManager.cs +++ b/Emby.Server.Implementations/Security/PluginSecurityManager.cs @@ -101,12 +101,6 @@ namespace Emby.Server.Implementations.Security /// <returns></returns> public async Task LoadAllRegistrationInfo() { - var response = await _httpClient.GetResponse(new HttpRequestOptions - { - Url = "http://192.168.1.2:8096/emby/Videos/663c8a38ccfe91af6566852f78e62c26/stream.mkv?Static=true&mediaSourceId=663c8a38ccfe91af6566852f78e62c26&deviceId=hyJA92oXn4RExFTGismCnY6da91kwnTvv8YvsYf0E&Tag=bcdc02b1cdd6f1eb4a57a6812831617b" - - }).ConfigureAwait(false); - var tasks = new List<Task>(); ResetSupporterInfo(); |
