Skip to content

Commit

Permalink
Merge pull request #2897 from MediaBrowser/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
LukePulverenti authored Sep 20, 2017
2 parents 707dca8 + 0eed9fc commit b182e54
Show file tree
Hide file tree
Showing 459 changed files with 5,529 additions and 6,585 deletions.
7 changes: 1 addition & 6 deletions Emby.Dlna/ContentDirectory/ContentDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Emby.Dlna.ContentDirectory
{
public class ContentDirectory : BaseService, IContentDirectory, IDisposable
public class ContentDirectory : BaseService, IContentDirectory
{
private readonly ILibraryManager _libraryManager;
private readonly IImageProcessor _imageProcessor;
Expand Down Expand Up @@ -143,10 +143,5 @@ private User GetUser(DeviceProfile profile)

return null;
}

public void Dispose()
{

}
}
}
18 changes: 8 additions & 10 deletions Emby.Dlna/ContentDirectory/ControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ private QueryResult<BaseItem> GetChildrenSorted(BaseItem item, User user, Search
{
Limit = limit,
StartIndex = startIndex,
SortBy = sortOrders.ToArray(sortOrders.Count),
SortOrder = sort.SortOrder,
OrderBy = sortOrders.Select(i => new Tuple<string, SortOrder>(i, sort.SortOrder)).ToArray(),
User = user,
Recursive = true,
IsMissing = false,
Expand Down Expand Up @@ -828,7 +827,7 @@ private QueryResult<ServerItem> GetMovieContinueWatching(BaseItem parent, User u
query.Parent = parent;
query.SetUser(user);

query.OrderBy = new List<Tuple<string, SortOrder>>
query.OrderBy = new Tuple<string, SortOrder>[]
{
new Tuple<string, SortOrder> (ItemSortBy.DatePlayed, SortOrder.Descending),
new Tuple<string, SortOrder> (ItemSortBy.SortName, SortOrder.Ascending)
Expand Down Expand Up @@ -1077,7 +1076,7 @@ private QueryResult<ServerItem> GetMusicPlaylists(BaseItem parent, User user, In

private QueryResult<ServerItem> GetMusicLatest(BaseItem parent, User user, InternalItemsQuery query)
{
query.SortBy = new string[] { };
query.OrderBy = new Tuple<string, SortOrder>[] { };

var items = _userViewManager.GetLatestItems(new LatestItemsQuery
{
Expand All @@ -1094,7 +1093,7 @@ private QueryResult<ServerItem> GetMusicLatest(BaseItem parent, User user, Inter

private QueryResult<ServerItem> GetNextUp(BaseItem parent, User user, InternalItemsQuery query)
{
query.SortBy = new string[] { };
query.OrderBy = new Tuple<string, SortOrder>[] { };

var result = _tvSeriesManager.GetNextUp(new NextUpQuery
{
Expand All @@ -1109,7 +1108,7 @@ private QueryResult<ServerItem> GetNextUp(BaseItem parent, User user, InternalIt

private QueryResult<ServerItem> GetTvLatest(BaseItem parent, User user, InternalItemsQuery query)
{
query.SortBy = new string[] { };
query.OrderBy = new Tuple<string, SortOrder>[] { };

var items = _userViewManager.GetLatestItems(new LatestItemsQuery
{
Expand All @@ -1126,7 +1125,7 @@ private QueryResult<ServerItem> GetTvLatest(BaseItem parent, User user, Internal

private QueryResult<ServerItem> GetMovieLatest(BaseItem parent, User user, InternalItemsQuery query)
{
query.SortBy = new string[] { };
query.OrderBy = new Tuple<string, SortOrder>[] { };

var items = _userViewManager.GetLatestItems(new LatestItemsQuery
{
Expand Down Expand Up @@ -1236,8 +1235,7 @@ private void SetSorting(InternalItemsQuery query, SortCriteria sort, bool isPreS
sortOrders.Add(ItemSortBy.SortName);
}

query.SortBy = sortOrders.ToArray(sortOrders.Count);
query.SortOrder = sort.SortOrder;
query.OrderBy = sortOrders.Select(i => new Tuple<string, SortOrder>(i, sort.SortOrder)).ToArray();
}

private QueryResult<ServerItem> GetItemsFromPerson(Person person, User user, int? startIndex, int? limit)
Expand All @@ -1246,7 +1244,7 @@ private QueryResult<ServerItem> GetItemsFromPerson(Person person, User user, int
{
PersonIds = new[] { person.Id.ToString("N") },
IncludeItemTypes = new[] { typeof(Movie).Name, typeof(Series).Name, typeof(Trailer).Name },
SortBy = new[] { ItemSortBy.SortName },
OrderBy = new[] { ItemSortBy.SortName }.Select(i => new Tuple<string, SortOrder>(i, SortOrder.Ascending)).ToArray(),
Limit = limit,
StartIndex = startIndex,
DtoOptions = GetDtoOptions()
Expand Down
2 changes: 1 addition & 1 deletion Emby.Dlna/DlnaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ private DeviceProfile ParseProfileFile(string path, DeviceProfileType type)
profile = ReserializeProfile(tempProfile);

profile.Id = path.ToLower().GetMD5().ToString("N");
profile.ProfileType = type;

_profiles[path] = new Tuple<InternalProfileInfo, DeviceProfile>(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile);

Expand Down Expand Up @@ -597,6 +596,7 @@ private void DumpProfiles()

public void Dispose()
{
GC.SuppressFinalize(this);
}
}
}
1 change: 1 addition & 0 deletions Emby.Dlna/Main/DlnaEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ public void Dispose()
_communicationsServer.Dispose();
_communicationsServer = null;
}
GC.SuppressFinalize(this);
}

public void DisposeDlnaServer()
Expand Down
7 changes: 1 addition & 6 deletions Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Emby.Dlna.MediaReceiverRegistrar
{
public class MediaReceiverRegistrar : BaseService, IMediaReceiverRegistrar, IDisposable
public class MediaReceiverRegistrar : BaseService, IMediaReceiverRegistrar
{
private readonly IServerConfigurationManager _config;
protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
Expand All @@ -33,10 +33,5 @@ public ControlResponse ProcessControlRequest(ControlRequest request)
Logger, XmlReaderSettingsFactory)
.ProcessControlRequest(request);
}

public void Dispose()
{

}
}
}
3 changes: 2 additions & 1 deletion Emby.Dlna/PlayTo/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private int GetPlaybackTimerIntervalMs()

private int GetInactiveTimerIntervalMs()
{
return Timeout.Infinite;
return 60000;
}

public void Start()
Expand Down Expand Up @@ -1105,6 +1105,7 @@ public void Dispose()
_disposed = true;

DisposeTimer();
GC.SuppressFinalize(this);
}
}

Expand Down
22 changes: 5 additions & 17 deletions Emby.Dlna/PlayTo/PlayToController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,7 @@ public bool IsSessionActive
{
get
{
var lastDateKnownActivity = _creationTime > _device.DateLastActivity ? _creationTime : _device.DateLastActivity;

if (DateTime.UtcNow >= lastDateKnownActivity.AddSeconds(120))
{
try
{
// Session is inactive, mark it for Disposal and don't start the elapsed timer.
_sessionManager.ReportSessionEnded(_session.Id);
}
catch (Exception ex)
{
_logger.ErrorException("Error in ReportSessionEnded", ex);
}
return false;
}

return _device != null;
return !_disposed && _device != null;
}
}

Expand Down Expand Up @@ -386,6 +370,9 @@ public Task SendPlaystateCommand(PlaystateRequest command, CancellationToken can
case PlaystateCommand.Unpause:
return _device.SetPlay();

case PlaystateCommand.PlayPause:
return _device.IsPaused ? _device.SetPlay() : _device.SetPause();

case PlaystateCommand.Seek:
{
return Seek(command.SeekPositionTicks ?? 0);
Expand Down Expand Up @@ -682,6 +669,7 @@ public void Dispose()
_device.OnDeviceUnavailable = null;

_device.Dispose();
GC.SuppressFinalize(this);
}
}

Expand Down
6 changes: 5 additions & 1 deletion Emby.Dlna/PlayTo/PlayToManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ async void _deviceDiscovery_DeviceDiscovered(object sender, GenericEventArgs<Upn
GeneralCommandType.SetSubtitleStreamIndex.ToString()
},

SupportsMediaControl = true
SupportsMediaControl = true,

// xbox one creates a new uuid everytime it restarts
SupportsPersistentIdentifier = (device.Properties.ModelName ?? string.Empty).IndexOf("xbox", StringComparison.OrdinalIgnoreCase) == -1
});

_logger.Info("DLNA Session created for {0} - {1}", device.Properties.Name, device.Properties.ModelName);
Expand Down Expand Up @@ -225,6 +228,7 @@ public void Dispose()
{
_disposed = true;
_deviceDiscovery.DeviceDiscovered -= _deviceDiscovery_DeviceDiscovered;
GC.SuppressFinalize(this);
}
}
}
9 changes: 4 additions & 5 deletions Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="ImageMagickSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageMagickSharp.1.0.0.18\lib\net45\ImageMagickSharp.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\ImageMagickSharp.1.0.0.19\lib\net45\ImageMagickSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -55,9 +54,6 @@
<ItemGroup>
<EmbeddedResource Include="fonts\robotoregular.ttf" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
Expand All @@ -72,6 +68,9 @@
<Name>MediaBrowser.Model</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 4 additions & 2 deletions Emby.Drawing.ImageMagick/ImageMagickEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Emby.Drawing.ImageMagick
{
public class ImageMagickEncoder : IImageEncoder
public class ImageMagickEncoder : IImageEncoder, IDisposable
{
private readonly ILogger _logger;
private readonly IApplicationPaths _appPaths;
Expand All @@ -38,7 +38,8 @@ public string[] SupportedInputFormats
// Some common file name extensions for RAW picture files include: .cr2, .crw, .dng, .nef, .orf, .rw2, .pef, .arw, .sr2, .srf, and .tif.
return new[]
{
"tiff",
"tiff",
"tif",
"jpeg",
"jpg",
"png",
Expand Down Expand Up @@ -327,6 +328,7 @@ public void Dispose()
{
_disposed = true;
Wand.CloseEnvironment();
GC.SuppressFinalize(this);
}

private void CheckDisposed()
Expand Down
2 changes: 1 addition & 1 deletion Emby.Drawing.ImageMagick/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ImageMagickSharp" version="1.0.0.18" targetFramework="net452" />
<package id="ImageMagickSharp" version="1.0.0.19" targetFramework="net452" />
</packages>
2 changes: 1 addition & 1 deletion Emby.Drawing.Skia/Emby.Drawing.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="SkiaSharp, Version=1.58.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\SkiaSharp.1.58.0\lib\portable-net45+win8+wpa81+wp8\SkiaSharp.dll</HintPath>
<HintPath>..\packages\SkiaSharp.1.58.1\lib\portable-net45+win8+wpa81+wp8\SkiaSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit b182e54

Please sign in to comment.