From 267ada923cde90f19f02deca5b6563b95f288bf6 Mon Sep 17 00:00:00 2001 From: softworkz Date: Wed, 27 Jul 2016 02:45:46 +0200 Subject: [PATCH 1/3] ChannelMediaInfo: Create audio stream even when there is no video --- MediaBrowser.Controller/Channels/ChannelMediaInfo.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs index 9424568b4..1216ae352 100644 --- a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs @@ -83,8 +83,7 @@ namespace MediaBrowser.Controller.Channels { var list = new List(); - if (!string.IsNullOrWhiteSpace(info.VideoCodec) && - !string.IsNullOrWhiteSpace(info.AudioCodec)) + if (!string.IsNullOrWhiteSpace(info.VideoCodec)) { list.Add(new MediaStream { @@ -99,7 +98,10 @@ namespace MediaBrowser.Controller.Channels BitRate = info.VideoBitrate, AverageFrameRate = info.Framerate }); + } + if (!string.IsNullOrWhiteSpace(info.AudioCodec)) + { list.Add(new MediaStream { Type = MediaStreamType.Audio, From 219cba75069cd2560e9571eee0c7f4a419256dab Mon Sep 17 00:00:00 2001 From: Sven Van den brande Date: Fri, 29 Jul 2016 21:18:03 +0200 Subject: [PATCH 2/3] Removed redundant Collection Initializers Removed Using directives that are not required --- MediaBrowser.Api/LiveTv/LiveTvService.cs | 5 +---- .../Playback/Hls/BaseHlsService.cs | 1 - .../Progressive/ProgressiveStreamWriter.cs | 2 -- MediaBrowser.Api/UserLibrary/ArtistsService.cs | 2 -- .../UserLibrary/GameGenresService.cs | 2 -- MediaBrowser.Api/UserLibrary/GenresService.cs | 1 - MediaBrowser.Api/UserLibrary/ItemsService.cs | 3 +-- .../UserLibrary/MusicGenresService.cs | 2 -- MediaBrowser.Controller/Channels/Channel.cs | 5 +---- MediaBrowser.Controller/Entities/Folder.cs | 6 +----- MediaBrowser.Controller/Entities/IHasImages.cs | 3 +-- .../Entities/IItemByName.cs | 3 +-- MediaBrowser.Controller/Entities/MusicVideo.cs | 1 - MediaBrowser.Controller/Entities/TV/Season.cs | 1 - MediaBrowser.Controller/Entities/Trailer.cs | 2 -- .../Entities/UserRootFolder.cs | 2 -- .../Entities/UserViewBuilder.cs | 3 --- .../LiveTv/LiveTvProgram.cs | 1 - .../LiveTv/LiveTvVideoRecording.cs | 1 - .../LiveTv/TimerEventInfo.cs | 8 +------- .../LiveTv/TunerChannelMapping.cs | 8 +------- .../MediaEncoding/EncodingJobOptions.cs | 3 +-- .../MediaEncoding/IMediaEncoder.cs | 1 - .../Channels/DlnaChannelFactory.cs | 18 +----------------- MediaBrowser.Dlna/Main/DlnaEntryPoint.cs | 2 -- MediaBrowser.Dlna/Ssdp/SsdpHandler.cs | 1 - MediaBrowser.LocalMetadata/BaseXmlProvider.cs | 1 - .../Savers/BoxSetXmlSaver.cs | 2 +- .../Savers/FolderXmlSaver.cs | 2 +- .../Savers/GameSystemXmlSaver.cs | 2 +- .../BdInfo/BdInfoExaminer.cs | 2 +- .../Encoder/EncoderValidator.cs | 1 - MediaBrowser.Model/Dto/BaseItemDto.cs | 1 - MediaBrowser.Model/Dto/BaseItemPerson.cs | 3 +-- MediaBrowser.Model/Dto/UserDto.cs | 1 - MediaBrowser.Model/Dto/UserItemDataDto.cs | 1 - MediaBrowser.Model/Extensions/ListHelper.cs | 2 +- MediaBrowser.Model/LiveTv/ChannelInfoDto.cs | 1 - MediaBrowser.Model/Session/SessionInfoDto.cs | 1 - .../Folders/CollectionFolderMetadataService.cs | 6 +----- .../MediaInfo/VideoImageProvider.cs | 1 - .../Movies/MovieDbProvider.cs | 1 - .../Movies/MovieDbTrailerProvider.cs | 1 - .../Music/FanArtAlbumProvider.cs | 1 - .../Omdb/OmdbImageProvider.cs | 2 -- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 1 - .../TV/MissingEpisodeProvider.cs | 8 ++------ .../TV/Omdb/OmdbEpisodeProvider.cs | 1 - .../TV/SeriesPostScanTask.cs | 1 - .../TV/TheTVDB/TvdbEpisodeImageProvider.cs | 1 - .../TV/TheTVDB/TvdbSeriesProvider.cs | 1 - .../Channels/ChannelManager.cs | 4 ++-- .../Dto/DtoService.cs | 5 ++--- .../EntryPoints/ExternalPortForwarding.cs | 2 -- .../EntryPoints/RecordingNotifier.cs | 3 --- .../IO/LibraryMonitor.cs | 2 -- .../Library/MediaSourceManager.cs | 3 +-- .../Library/Resolvers/TV/EpisodeResolver.cs | 1 - .../Library/UserDataManager.cs | 1 - .../Library/Validators/StudiosValidator.cs | 3 +-- .../Library/Validators/YearsPostScanTask.cs | 1 - .../LiveTv/EmbyTV/EmbyTV.cs | 3 --- .../LiveTv/Listings/XmlTvListingsProvider.cs | 1 - .../LiveTv/TunerHosts/M3UTunerHost.cs | 2 +- .../LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs | 2 -- .../LiveTv/TunerHosts/SatIp/SatIpHost.cs | 2 +- .../Persistence/DataExtensions.cs | 1 - .../Persistence/SqliteExtensions.cs | 5 ----- .../Sorting/DateLastMediaAddedComparer.cs | 1 - .../Sync/SyncJobProcessor.cs | 3 +-- .../Sync/SyncManager.cs | 2 +- MediaBrowser.Server.Mono/Native/DbConnector.cs | 4 +--- .../ApplicationHost.cs | 4 +--- .../Browser/BrowserLauncher.cs | 2 -- .../Migrations/CollectionGroupingMigration.cs | 6 +----- .../Migrations/CollectionsViewMigration.cs | 6 +----- MediaBrowser.ServerApplication/MainStartup.cs | 1 - .../Native/DbConnector.cs | 4 +--- .../Native/LnkShortcutHandler.cs | 3 --- .../Native/WindowsApp.cs | 1 - .../ConsistencyTests/StringUsageReporter.cs | 1 - .../TextIndexing/IndexBuilder.cs | 2 -- .../ConsistencyTests/TextIndexing/WordIndex.cs | 3 --- .../TextIndexing/WordOccurrence.cs | 8 +------- .../TextIndexing/WordOccurrences.cs | 6 +----- .../Providers/BaseNfoProvider.cs | 1 - 86 files changed, 36 insertions(+), 195 deletions(-) diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index c687758b7..91157cd11 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -997,10 +997,7 @@ namespace MediaBrowser.Api.LiveTv public async Task Get(GetRecordingGroup request) { - var result = await _liveTvManager.GetRecordingGroups(new RecordingGroupQuery - { - - }, CancellationToken.None).ConfigureAwait(false); + var result = await _liveTvManager.GetRecordingGroups(new RecordingGroupQuery(), CancellationToken.None).ConfigureAwait(false); var group = result.Items.FirstOrDefault(i => string.Equals(i.Id, request.Id, StringComparison.OrdinalIgnoreCase)); diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 3d8957086..4ec14c96c 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -3,7 +3,6 @@ using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; -using MediaBrowser.Model.Entities; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; using MediaBrowser.Model.Net; diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs index 860e57b32..2019b73c8 100644 --- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs +++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs @@ -1,7 +1,5 @@ using MediaBrowser.Model.Logging; -using ServiceStack.Web; using System; -using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index df73ef720..ad031f483 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -8,8 +8,6 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Dto; using ServiceStack; using System.Collections.Generic; -using System.Linq; -using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; namespace MediaBrowser.Api.UserLibrary diff --git a/MediaBrowser.Api/UserLibrary/GameGenresService.cs b/MediaBrowser.Api/UserLibrary/GameGenresService.cs index a0883f98c..a0f3855c5 100644 --- a/MediaBrowser.Api/UserLibrary/GameGenresService.cs +++ b/MediaBrowser.Api/UserLibrary/GameGenresService.cs @@ -4,11 +4,9 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; using ServiceStack; using System; using System.Collections.Generic; -using System.Linq; using MediaBrowser.Model.Querying; namespace MediaBrowser.Api.UserLibrary diff --git a/MediaBrowser.Api/UserLibrary/GenresService.cs b/MediaBrowser.Api/UserLibrary/GenresService.cs index 57c11a1fa..ec2bc6bda 100644 --- a/MediaBrowser.Api/UserLibrary/GenresService.cs +++ b/MediaBrowser.Api/UserLibrary/GenresService.cs @@ -8,7 +8,6 @@ using MediaBrowser.Model.Entities; using ServiceStack; using System; using System.Collections.Generic; -using System.Linq; using MediaBrowser.Model.Querying; namespace MediaBrowser.Api.UserLibrary diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index b4d88a7f8..97a81b790 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Collections; -using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Localization; diff --git a/MediaBrowser.Api/UserLibrary/MusicGenresService.cs b/MediaBrowser.Api/UserLibrary/MusicGenresService.cs index 887c99941..b2eba070f 100644 --- a/MediaBrowser.Api/UserLibrary/MusicGenresService.cs +++ b/MediaBrowser.Api/UserLibrary/MusicGenresService.cs @@ -8,8 +8,6 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Dto; using ServiceStack; using System.Collections.Generic; -using System.Linq; -using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; namespace MediaBrowser.Api.UserLibrary diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs index 718a0d878..e0b7204b8 100644 --- a/MediaBrowser.Controller/Channels/Channel.cs +++ b/MediaBrowser.Controller/Channels/Channel.cs @@ -57,10 +57,7 @@ namespace MediaBrowser.Controller.Channels catch { // Already logged at lower levels - return new QueryResult - { - - }; + return new QueryResult(); } } diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 0397e9a88..6a7e279be 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1,5 +1,4 @@ using MediaBrowser.Common.Progress; -using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Dto; @@ -919,10 +918,7 @@ namespace MediaBrowser.Controller.Entities catch { // Already logged at lower levels - return new QueryResult - { - - }; + return new QueryResult(); } } diff --git a/MediaBrowser.Controller/Entities/IHasImages.cs b/MediaBrowser.Controller/Entities/IHasImages.cs index 226748098..a38b7394d 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -1,5 +1,4 @@ -using System; -using MediaBrowser.Controller.Providers; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using System.Collections.Generic; using System.Threading; diff --git a/MediaBrowser.Controller/Entities/IItemByName.cs b/MediaBrowser.Controller/Entities/IItemByName.cs index 2ac4af1af..b69c8bdfc 100644 --- a/MediaBrowser.Controller/Entities/IItemByName.cs +++ b/MediaBrowser.Controller/Entities/IItemByName.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index 7119828e2..8b749b7a5 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -1,7 +1,6 @@ using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; using System.Collections.Generic; using System.Runtime.Serialization; diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index ee01c60b1..f6ca19005 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -1,6 +1,5 @@ using System; using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; using MediaBrowser.Model.Users; using MoreLinq; diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index eab5ab679..6604be977 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -2,9 +2,7 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using System.Collections.Generic; -using System.Globalization; using System.Runtime.Serialization; -using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Model.Providers; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs index 8e6f11c2c..4549d0d1d 100644 --- a/MediaBrowser.Controller/Entities/UserRootFolder.cs +++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs @@ -1,6 +1,5 @@ using System.Runtime.Serialization; using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Dto; using MediaBrowser.Model.Library; using MediaBrowser.Model.Querying; using System; @@ -8,7 +7,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Controller.Library; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index e2228bcaf..11ed26931 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -1,5 +1,4 @@ using MediaBrowser.Controller.Channels; -using MediaBrowser.Controller.Collections; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; @@ -14,12 +13,10 @@ using MediaBrowser.Model.Logging; using MediaBrowser.Model.Querying; using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Configuration; -using MediaBrowser.Model.Configuration; using MoreLinq; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 74c993248..c7f47b825 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -1,5 +1,4 @@ using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.LiveTv; diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index a8c737673..f4dba070d 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -1,5 +1,4 @@ using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; diff --git a/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs b/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs index 0e1a05475..642dee3af 100644 --- a/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs +++ b/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaBrowser.Controller.LiveTv +namespace MediaBrowser.Controller.LiveTv { public class TimerEventInfo { diff --git a/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs b/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs index da0527eea..c1d1c413e 100644 --- a/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs +++ b/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaBrowser.Controller.LiveTv +namespace MediaBrowser.Controller.LiveTv { public class TunerChannelMapping { diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs index 44b741755..844fafcde 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs @@ -1,5 +1,4 @@ -using System.Linq; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dlna; namespace MediaBrowser.Controller.MediaEncoding { diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs index c8a8caa91..05e82a16e 100644 --- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs +++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs @@ -1,7 +1,6 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.MediaInfo; using System; -using System.IO; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.Dlna; diff --git a/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs b/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs index a8e778751..06856989f 100644 --- a/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs +++ b/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs @@ -1,20 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Channels; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Dlna; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Dlna.ContentDirectory; -using MediaBrowser.Dlna.PlayTo; -using MediaBrowser.Model.Channels; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Logging; - -namespace MediaBrowser.Dlna.Channels +namespace MediaBrowser.Dlna.Channels { //public class DlnaChannel : IChannel, IDisposable //{ diff --git a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs index b9d9944ec..fbd027ccf 100644 --- a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs +++ b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs @@ -14,10 +14,8 @@ using MediaBrowser.Dlna.Ssdp; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using MediaBrowser.Controller.MediaEncoding; -using MediaBrowser.Dlna.Channels; namespace MediaBrowser.Dlna.Main { diff --git a/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs b/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs index 0e791eb98..720ea71a0 100644 --- a/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs +++ b/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs @@ -6,7 +6,6 @@ using MediaBrowser.Controller.Dlna; using MediaBrowser.Dlna.Server; using MediaBrowser.Model.Logging; using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/MediaBrowser.LocalMetadata/BaseXmlProvider.cs b/MediaBrowser.LocalMetadata/BaseXmlProvider.cs index 4b64295ea..0289ffb08 100644 --- a/MediaBrowser.LocalMetadata/BaseXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/BaseXmlProvider.cs @@ -1,6 +1,5 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; -using System; using System.IO; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs index 31a2901b7..b307ded97 100644 --- a/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs +++ b/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs @@ -65,7 +65,7 @@ namespace MediaBrowser.LocalMetadata.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath, new List { }, _config, _fileSystem); + XmlSaverHelpers.Save(builder, xmlFilePath, new List(), _config, _fileSystem); } /// diff --git a/MediaBrowser.LocalMetadata/Savers/FolderXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/FolderXmlSaver.cs index 056bd49a8..8dad16fc2 100644 --- a/MediaBrowser.LocalMetadata/Savers/FolderXmlSaver.cs +++ b/MediaBrowser.LocalMetadata/Savers/FolderXmlSaver.cs @@ -79,7 +79,7 @@ namespace MediaBrowser.LocalMetadata.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath, new List { }, _config, _fileSystem); + XmlSaverHelpers.Save(builder, xmlFilePath, new List(), _config, _fileSystem); } /// diff --git a/MediaBrowser.LocalMetadata/Savers/GameSystemXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/GameSystemXmlSaver.cs index dea4721af..ddfaedba6 100644 --- a/MediaBrowser.LocalMetadata/Savers/GameSystemXmlSaver.cs +++ b/MediaBrowser.LocalMetadata/Savers/GameSystemXmlSaver.cs @@ -72,7 +72,7 @@ namespace MediaBrowser.LocalMetadata.Savers var xmlFilePath = GetSavePath(item); - XmlSaverHelpers.Save(builder, xmlFilePath, new List { }, _config, _fileSystem); + XmlSaverHelpers.Save(builder, xmlFilePath, new List(), _config, _fileSystem); } /// diff --git a/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs b/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs index b15b8d15d..e435c00f2 100644 --- a/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs +++ b/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs @@ -40,7 +40,7 @@ namespace MediaBrowser.MediaEncoding.BdInfo outputStream.RunTimeTicks = TimeSpan.FromSeconds(playlist.TotalLength).Ticks; - var mediaStreams = new List { }; + var mediaStreams = new List(); foreach (var stream in playlist.SortedStreams) { diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 0866bd255..50df08e66 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using MediaBrowser.Model.Logging; namespace MediaBrowser.MediaEncoding.Encoder diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 8ca1dfcb1..6edf743fb 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -7,7 +7,6 @@ using MediaBrowser.Model.Providers; using MediaBrowser.Model.Sync; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Runtime.Serialization; diff --git a/MediaBrowser.Model/Dto/BaseItemPerson.cs b/MediaBrowser.Model/Dto/BaseItemPerson.cs index b74912907..7052f1b82 100644 --- a/MediaBrowser.Model/Dto/BaseItemPerson.cs +++ b/MediaBrowser.Model/Dto/BaseItemPerson.cs @@ -1,5 +1,4 @@ -using System.ComponentModel; -using System.Diagnostics; +using System.Diagnostics; using System.Runtime.Serialization; namespace MediaBrowser.Model.Dto diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs index 18470466c..94e4f95a3 100644 --- a/MediaBrowser.Model/Dto/UserDto.cs +++ b/MediaBrowser.Model/Dto/UserDto.cs @@ -2,7 +2,6 @@ using MediaBrowser.Model.Connect; using MediaBrowser.Model.Users; using System; -using System.ComponentModel; using System.Diagnostics; using System.Runtime.Serialization; diff --git a/MediaBrowser.Model/Dto/UserItemDataDto.cs b/MediaBrowser.Model/Dto/UserItemDataDto.cs index 00491002b..507dbb06d 100644 --- a/MediaBrowser.Model/Dto/UserItemDataDto.cs +++ b/MediaBrowser.Model/Dto/UserItemDataDto.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.cs index 741f07469..711e0ce9c 100644 --- a/MediaBrowser.Model/Extensions/ListHelper.cs +++ b/MediaBrowser.Model/Extensions/ListHelper.cs @@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Extensions { if (value == null) { - throw new ArgumentNullException("value"); + throw new ArgumentNullException(nameof(value)); } return list.Contains(value, StringComparer.OrdinalIgnoreCase); diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs index aa91e3c74..8991aad86 100644 --- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs @@ -2,7 +2,6 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Library; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Runtime.Serialization; diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs index 5c3c9a79c..42263c644 100644 --- a/MediaBrowser.Model/Session/SessionInfoDto.cs +++ b/MediaBrowser.Model/Session/SessionInfoDto.cs @@ -1,7 +1,6 @@ using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; namespace MediaBrowser.Model.Session diff --git a/MediaBrowser.Providers/Folders/CollectionFolderMetadataService.cs b/MediaBrowser.Providers/Folders/CollectionFolderMetadataService.cs index 35c61b5c5..cdaa38366 100644 --- a/MediaBrowser.Providers/Folders/CollectionFolderMetadataService.cs +++ b/MediaBrowser.Providers/Folders/CollectionFolderMetadataService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using CommonIO; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; diff --git a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs index 5fc363062..fb08f00c1 100644 --- a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs @@ -10,7 +10,6 @@ using MediaBrowser.Model.Logging; using MediaBrowser.Model.MediaInfo; using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs index 27b61225b..b0d119ff9 100644 --- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs @@ -6,7 +6,6 @@ using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Providers; diff --git a/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs b/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs index 1d8691ab8..81df7b805 100644 --- a/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs @@ -2,7 +2,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Providers; -using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs index a14c7123a..2f09d64af 100644 --- a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs @@ -6,7 +6,6 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; -using MediaBrowser.Providers.TV; using System; using System.Collections.Generic; using System.Globalization; diff --git a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs index 563118940..90d172bc2 100644 --- a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs @@ -10,8 +10,6 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; using MediaBrowser.Model.Serialization; using System.Collections.Generic; -using System.IO; -using System.Text; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index 037931300..f3766f007 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -1,5 +1,4 @@ using CommonIO; -using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; diff --git a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs index 22e126795..afa1abbbb 100644 --- a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs @@ -135,9 +135,7 @@ namespace MediaBrowser.Providers.TV { var directoryService = new DirectoryService(_fileSystem); - await series.RefreshMetadata(new MetadataRefreshOptions(directoryService) - { - }, cancellationToken).ConfigureAwait(false); + await series.RefreshMetadata(new MetadataRefreshOptions(directoryService), cancellationToken).ConfigureAwait(false); await series.ValidateChildren(new Progress(), cancellationToken, new MetadataRefreshOptions(directoryService), true) .ConfigureAwait(false); @@ -438,9 +436,7 @@ namespace MediaBrowser.Providers.TV await season.AddChild(episode, cancellationToken).ConfigureAwait(false); - await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem) - { - }, cancellationToken).ConfigureAwait(false); + await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false); } /// diff --git a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs index 64e30f47f..621f66514 100644 --- a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs @@ -10,7 +10,6 @@ using MediaBrowser.Model.Providers; using MediaBrowser.Model.Serialization; using MediaBrowser.Providers.Omdb; using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Providers/TV/SeriesPostScanTask.cs b/MediaBrowser.Providers/TV/SeriesPostScanTask.cs index d044c828f..d6ae84b91 100644 --- a/MediaBrowser.Providers/TV/SeriesPostScanTask.cs +++ b/MediaBrowser.Providers/TV/SeriesPostScanTask.cs @@ -14,7 +14,6 @@ using CommonIO; using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Plugins; -using MediaBrowser.Model.Tasks; namespace MediaBrowser.Providers.TV { diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs index 881513286..a0280cf40 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs @@ -6,7 +6,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; -using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs index b6cc8777d..66a02eba2 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs @@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index 41592865c..bb7e142b6 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -657,7 +657,7 @@ namespace MediaBrowser.Server.Implementations.Channels _logger.ErrorException("Error getting all media from {0}", ex, i.Name); } } - return new Tuple(i, new ChannelItemResult { }); + return new Tuple(i, new ChannelItemResult()); }); var results = await Task.WhenAll(tasks).ConfigureAwait(false); @@ -811,7 +811,7 @@ namespace MediaBrowser.Server.Implementations.Channels _logger.ErrorException("Error getting all media from {0}", ex, i.Name); } } - return new Tuple(i, new ChannelItemResult { }); + return new Tuple(i, new ChannelItemResult()); }); var results = await Task.WhenAll(tasks).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 616625bc9..f17f5e5a2 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -11,7 +11,6 @@ using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.Persistence; -using MediaBrowser.Controller.Playlists; using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Sync; using MediaBrowser.Model.Drawing; @@ -102,8 +101,8 @@ namespace MediaBrowser.Server.Implementations.Dto var syncDictionary = GetSyncedItemProgressDictionary(syncJobItems); var list = new List(); - var programTuples = new List> { }; - var channelTuples = new List> { }; + var programTuples = new List>(); + var channelTuples = new List>(); foreach (var item in items) { diff --git a/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index 50ad3cfbc..64e3c56a6 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -7,9 +7,7 @@ using Mono.Nat; using System; using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Net; -using System.Text; using MediaBrowser.Common.Threading; namespace MediaBrowser.Server.Implementations.EntryPoints diff --git a/MediaBrowser.Server.Implementations/EntryPoints/RecordingNotifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/RecordingNotifier.cs index cc4ef1972..620eea774 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/RecordingNotifier.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/RecordingNotifier.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.Plugins; diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs index 99cb80cb2..8c2b927e3 100644 --- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs +++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs @@ -5,14 +5,12 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Logging; -using MediaBrowser.Server.Implementations.ScheduledTasks; using Microsoft.Win32; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Threading; using System.Threading.Tasks; using CommonIO; using MediaBrowser.Controller; diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs index 696bd0f4d..4a533ff93 100644 --- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs +++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs @@ -278,8 +278,7 @@ namespace MediaBrowser.Server.Implementations.Library } var preferredSubs = string.IsNullOrEmpty(user.Configuration.SubtitleLanguagePreference) - ? new List { } - : new List { user.Configuration.SubtitleLanguagePreference }; + ? new List() : new List { user.Configuration.SubtitleLanguagePreference }; var defaultAudioIndex = source.DefaultAudioStreamIndex; var audioLangage = defaultAudioIndex == null diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs index 7b8832c59..2f940eb1d 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using System.Linq; diff --git a/MediaBrowser.Server.Implementations/Library/UserDataManager.cs b/MediaBrowser.Server.Implementations/Library/UserDataManager.cs index 715f3c522..307cf4cd2 100644 --- a/MediaBrowser.Server.Implementations/Library/UserDataManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserDataManager.cs @@ -10,7 +10,6 @@ using MediaBrowser.Model.Logging; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs index c1803b5e4..e697dbd90 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Server.Implementations/Library/Validators/YearsPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/YearsPostScanTask.cs index 7f52a4506..164b14223 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/YearsPostScanTask.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/YearsPostScanTask.cs @@ -1,7 +1,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; using System; -using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 8f56554f1..a36eae8d2 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -12,7 +12,6 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Events; -using MediaBrowser.Model.FileOrganization; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; @@ -26,8 +25,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using CommonIO; -using MediaBrowser.Common.Events; -using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Power; diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index 1e82e3fce..d1d8df2e8 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -11,7 +11,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Emby.XmlTv.Classes; -using Emby.XmlTv.Entities; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index 2a974b545..5b83e7cbe 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -141,7 +141,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts return new List { mediaSource }; } - return new List { }; + return new List(); } protected override Task IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken) diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs index d0a55966f..43f48b37b 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs @@ -1,6 +1,4 @@ using System; -using System.Globalization; -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs index 1e571c84f..b1e349a86 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs @@ -110,7 +110,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp return new List { mediaSource }; } - return new List { }; + return new List(); } protected override async Task GetChannelStream(TunerHostInfo tuner, string channelId, string streamId, CancellationToken cancellationToken) diff --git a/MediaBrowser.Server.Implementations/Persistence/DataExtensions.cs b/MediaBrowser.Server.Implementations/Persistence/DataExtensions.cs index 61ce6e351..a16d23700 100644 --- a/MediaBrowser.Server.Implementations/Persistence/DataExtensions.cs +++ b/MediaBrowser.Server.Implementations/Persistence/DataExtensions.cs @@ -4,7 +4,6 @@ using MediaBrowser.Model.Serialization; using System; using System.Data; using System.IO; -using System.Threading.Tasks; namespace MediaBrowser.Server.Implementations.Persistence { diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs index d5b582da5..c273d4945 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; using System.Data; using System.Data.SQLite; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; namespace MediaBrowser.Server.Implementations.Persistence diff --git a/MediaBrowser.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs b/MediaBrowser.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs index e8c78b8e7..5080edffd 100644 --- a/MediaBrowser.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs @@ -3,7 +3,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; using System; -using System.Linq; namespace MediaBrowser.Server.Implementations.Sorting { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs index e120d3a4d..d5dfd3856 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs @@ -951,8 +951,7 @@ namespace MediaBrowser.Server.Implementations.Sync : new[] { user.Configuration.AudioLanguagePreference }; var preferredSubs = string.IsNullOrEmpty(user.Configuration.SubtitleLanguagePreference) - ? new List { } - : new List { user.Configuration.SubtitleLanguagePreference }; + ? new List() : new List { user.Configuration.SubtitleLanguagePreference }; foreach (var source in mediaSources) { diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs index 38edc3024..92221ffba 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs @@ -152,7 +152,7 @@ namespace MediaBrowser.Server.Implementations.Sync UserId = request.UserId, UnwatchedOnly = request.UnwatchedOnly, ItemLimit = request.ItemLimit, - RequestedItemIds = request.ItemIds ?? new List { }, + RequestedItemIds = request.ItemIds ?? new List(), DateCreated = DateTime.UtcNow, DateLastModified = DateTime.UtcNow, SyncNewContent = request.SyncNewContent, diff --git a/MediaBrowser.Server.Mono/Native/DbConnector.cs b/MediaBrowser.Server.Mono/Native/DbConnector.cs index 5ad3ecfef..39b53b370 100644 --- a/MediaBrowser.Server.Mono/Native/DbConnector.cs +++ b/MediaBrowser.Server.Mono/Native/DbConnector.cs @@ -1,6 +1,4 @@ -using System; -using System.Data; -using System.Data.SQLite; +using System.Data; using System.Threading.Tasks; using MediaBrowser.Model.Logging; using MediaBrowser.Server.Implementations.Persistence; diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index b7ea5bdad..3f1f98cd0 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -362,9 +362,7 @@ namespace MediaBrowser.Server.Startup.Common private void PerformPreInitMigrations() { - var migrations = new List - { - }; + var migrations = new List(); foreach (var task in migrations) { diff --git a/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs b/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs index db48d1110..6b3602a73 100644 --- a/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs +++ b/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs @@ -1,7 +1,5 @@ using MediaBrowser.Controller; -using MediaBrowser.Model.Logging; using System; -using System.Diagnostics; namespace MediaBrowser.Server.Startup.Common.Browser { diff --git a/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs index b497eeb42..5041c49b8 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; diff --git a/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs index c6186ce08..3f68ec48b 100644 --- a/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs +++ b/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index bdfd7d1bb..a87ad7dbf 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -19,7 +19,6 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using CommonIO.Windows; -using Emby.Drawing.ImageMagick; using ImageMagickSharp; using MediaBrowser.Common.Net; using MediaBrowser.Server.Implementations.Logging; diff --git a/MediaBrowser.ServerApplication/Native/DbConnector.cs b/MediaBrowser.ServerApplication/Native/DbConnector.cs index 9aaa96a80..f403ce2ce 100644 --- a/MediaBrowser.ServerApplication/Native/DbConnector.cs +++ b/MediaBrowser.ServerApplication/Native/DbConnector.cs @@ -1,6 +1,4 @@ -using System; -using System.Data; -using System.Data.SQLite; +using System.Data; using System.Threading.Tasks; using MediaBrowser.Model.Logging; using MediaBrowser.Server.Implementations.Persistence; diff --git a/MediaBrowser.ServerApplication/Native/LnkShortcutHandler.cs b/MediaBrowser.ServerApplication/Native/LnkShortcutHandler.cs index 67d2e83f0..dc1e3c79b 100644 --- a/MediaBrowser.ServerApplication/Native/LnkShortcutHandler.cs +++ b/MediaBrowser.ServerApplication/Native/LnkShortcutHandler.cs @@ -1,11 +1,8 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Runtime.InteropServices; using System.Security; using System.Text; -using System.Threading.Tasks; using CommonIO; namespace MediaBrowser.ServerApplication.Native diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs index d8b2720c2..3c9c04acb 100644 --- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs +++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs @@ -7,7 +7,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; -using System.Windows.Forms; using CommonIO; using MediaBrowser.Controller.Power; using MediaBrowser.Model.System; diff --git a/MediaBrowser.Tests/ConsistencyTests/StringUsageReporter.cs b/MediaBrowser.Tests/ConsistencyTests/StringUsageReporter.cs index d036a6c6d..bea709c5c 100644 --- a/MediaBrowser.Tests/ConsistencyTests/StringUsageReporter.cs +++ b/MediaBrowser.Tests/ConsistencyTests/StringUsageReporter.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Xml; namespace MediaBrowser.Tests.ConsistencyTests diff --git a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/IndexBuilder.cs b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/IndexBuilder.cs index 07c0df86c..e88e3ae29 100644 --- a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/IndexBuilder.cs +++ b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/IndexBuilder.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing { diff --git a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordIndex.cs b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordIndex.cs index 4ced81237..60b88dd5e 100644 --- a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordIndex.cs +++ b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordIndex.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing { diff --git a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrence.cs b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrence.cs index 40631f582..7564d90f3 100644 --- a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrence.cs +++ b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrence.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing +namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing { public struct WordOccurrence { diff --git a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrences.cs b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrences.cs index 3ba3b5916..821a74d21 100644 --- a/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrences.cs +++ b/MediaBrowser.Tests/ConsistencyTests/TextIndexing/WordOccurrences.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace MediaBrowser.Tests.ConsistencyTests.TextIndexing { diff --git a/MediaBrowser.XbmcMetadata/Providers/BaseNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/BaseNfoProvider.cs index c1dd92987..f3c40a169 100644 --- a/MediaBrowser.XbmcMetadata/Providers/BaseNfoProvider.cs +++ b/MediaBrowser.XbmcMetadata/Providers/BaseNfoProvider.cs @@ -1,7 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.XbmcMetadata.Savers; -using System; using System.IO; using System.Threading; using System.Threading.Tasks; From f7c3ee1c6800d98ab1f71a7807a962c682254625 Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 30 Jul 2016 01:44:14 +0200 Subject: [PATCH 3/3] Fix: Emby notification icon remained visible after shutdown Also implemented the recommended pattern for IDisposable. --- MediaBrowser.ServerApplication/MainStartup.cs | 6 ++ .../ServerNotifyIcon.cs | 69 ++++++------------- 2 files changed, 26 insertions(+), 49 deletions(-) diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index bdfd7d1bb..aba4952f3 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -619,6 +619,12 @@ namespace MediaBrowser.ServerApplication private static void ShutdownWindowsApplication() { + if (_serverNotifyIcon != null) + { + _serverNotifyIcon.Dispose(); + _serverNotifyIcon = null; + } + //_logger.Info("Calling Application.Exit"); //Application.Exit(); diff --git a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs b/MediaBrowser.ServerApplication/ServerNotifyIcon.cs index 27816db5a..d04128a18 100644 --- a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs +++ b/MediaBrowser.ServerApplication/ServerNotifyIcon.cs @@ -4,14 +4,13 @@ using MediaBrowser.Controller.Localization; using MediaBrowser.Model.Logging; using MediaBrowser.Server.Startup.Common.Browser; using System; +using System.ComponentModel; using System.Windows.Forms; namespace MediaBrowser.ServerApplication { public class ServerNotifyIcon : IDisposable { - bool IsDisposing = false; - private NotifyIcon notifyIcon1; private ContextMenuStrip contextMenuStrip1; private ToolStripMenuItem cmdExit; @@ -21,25 +20,13 @@ namespace MediaBrowser.ServerApplication private ToolStripMenuItem cmdRestart; private ToolStripSeparator toolStripSeparator1; private ToolStripMenuItem cmdCommunity; + private Container components; private readonly ILogger _logger; private readonly IServerApplicationHost _appHost; private readonly IServerConfigurationManager _configurationManager; private readonly ILocalizationManager _localization; - public bool Visible - { - get - { - return notifyIcon1.Visible; - } - set - { - Action act = () => notifyIcon1.Visible = false; - Invoke(act); - } - } - public void Invoke(Action action) { contextMenuStrip1.Invoke(action); @@ -55,7 +42,7 @@ namespace MediaBrowser.ServerApplication _appHost = appHost; _configurationManager = configurationManager; - var components = new System.ComponentModel.Container(); + components = new System.ComponentModel.Container(); var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); contextMenuStrip1 = new ContextMenuStrip(components); @@ -138,32 +125,6 @@ namespace MediaBrowser.ServerApplication LocalizeText(); notifyIcon1.DoubleClick += notifyIcon1_DoubleClick; - Application.ThreadExit += Application_ThreadExit; - Application.ApplicationExit += Application_ApplicationExit; - } - - void Application_ThreadExit(object sender, EventArgs e) - { - try - { - notifyIcon1.Visible = false; - } - catch - { - - } - } - - void Application_ApplicationExit(object sender, EventArgs e) - { - try - { - notifyIcon1.Visible = false; - } - catch - { - - } } void notifyIcon1_DoubleClick(object sender, EventArgs e) @@ -222,16 +183,26 @@ namespace MediaBrowser.ServerApplication _appHost.Shutdown(); } - ~ServerNotifyIcon() - { - Dispose(); - } - public void Dispose() { - if (!IsDisposing) + Dispose(true); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) { - IsDisposing = true; + if (notifyIcon1 != null) + { + notifyIcon1.Visible = false; + notifyIcon1.Dispose(); + notifyIcon1 = null; + } + + if (components != null) + { + components.Dispose(); + } } } }