Skip to content

Commit

Permalink
fixes jellyfin#795 - Support reading Xbmc nfo's
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Jun 30, 2014
1 parent 1a5a758 commit 3d47b49
Show file tree
Hide file tree
Showing 89 changed files with 4,349 additions and 306 deletions.
16 changes: 13 additions & 3 deletions MediaBrowser.Api/Playback/BaseStreamingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,16 @@ protected async Task<StreamState> GetState(StreamRequest request, CancellationTo
state.MediaPath = mediaUrl;
state.InputProtocol = MediaProtocol.Http;
}
else
{
// No media info, so this is probably needed
state.DeInterlace = true;
}

if (recording.RecordingInfo.Status == RecordingStatus.InProgress)
{
state.ReadInputAtNativeFramerate = true;
}

state.RunTimeTicks = recording.RunTimeTicks;

Expand All @@ -1455,9 +1465,7 @@ protected async Task<StreamState> GetState(StreamRequest request, CancellationTo
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
}

state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress;
state.OutputAudioSync = "1000";
state.DeInterlace = true;
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
state.InputContainer = recording.Container;
Expand Down Expand Up @@ -1524,7 +1532,9 @@ protected async Task<StreamState> GetState(StreamRequest request, CancellationTo
state.RunTimeTicks = mediaSource.RunTimeTicks;
}

if (string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase))
// If it's a wtv and we don't have media info, we will probably need to deinterlace
if (string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase) &&
mediaStreams.Count == 0)
{
state.DeInterlace = true;
}
Expand Down
5 changes: 5 additions & 0 deletions MediaBrowser.Api/Playback/BifService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ private async Task<string> GetBifFile(GetBifFile request)

try
{
if (File.Exists(path))
{
return path;
}

await _mediaEncoder.ExtractVideoImagesOnInterval(inputPath, protocol, mediaSource.Video3DFormat,
TimeSpan.FromSeconds(10), Path.GetDirectoryName(path), "img_", request.MaxWidth, CancellationToken.None)
.ConfigureAwait(false);
Expand Down
3 changes: 2 additions & 1 deletion MediaBrowser.Api/Playback/Progressive/VideoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ private string GetVideoArguments(StreamState state, string codec)
return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb" : args;
}

const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5))";
var keyFrameArg = string.Format(" -force_key_frames expr:gte(t,n_forced*{0})",
5.ToString(UsCulture));

args += keyFrameArg;

Expand Down
5 changes: 0 additions & 5 deletions MediaBrowser.Controller/Entities/Folder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,6 @@ protected async virtual Task ValidateChildrenInternal(IProgress<double> progress

cancellationToken.ThrowIfCancellationRequested();

if (this is UserRootFolder)
{
var b = true;
}

foreach (var child in nonCachedChildren)
{
BaseItem currentChild;
Expand Down
2 changes: 1 addition & 1 deletion MediaBrowser.Dlna/PlayTo/PlayToController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void Init(Device device)
_updateTimer = new Timer(updateTimer_Elapsed, null, 60000, 60000);
}

private async void updateTimer_Elapsed(object state)
private void updateTimer_Elapsed(object state)
{
if (DateTime.UtcNow >= _device.DateLastActivity.AddSeconds(120))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using System;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;

namespace MediaBrowser.Providers
namespace MediaBrowser.LocalMetadata
{
public abstract class BaseXmlProvider<T> : ILocalMetadataProvider<T>, IHasChangeMonitor
where T : IHasMetadata, new()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using MediaBrowser.Controller.Entities;
using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Providers.All;
using System.Collections.Generic;

namespace MediaBrowser.Providers.Folders
namespace MediaBrowser.LocalMetadata.Images
{
public class CollectionFolderLocalImageProvider : ILocalImageFileProvider, IHasOrder
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Providers.TV
namespace MediaBrowser.LocalMetadata.Images
{
public class EpisodeLocalLocalImageProvider : ILocalImageFileProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using MediaBrowser.Common.IO;
using System.Collections.Generic;
using System.IO;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Providers.All;
using System.Collections.Generic;
using System.IO;

namespace MediaBrowser.Providers.Folders
namespace MediaBrowser.LocalMetadata.Images
{
public class ImagesByNameImageProvider : ILocalImageFileProvider, IHasOrder
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using MediaBrowser.Controller.Configuration;
using System.Collections.Generic;
using System.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Providers;
using System.Collections.Generic;
using System.IO;

namespace MediaBrowser.Providers.All
namespace MediaBrowser.LocalMetadata.Images
{
public class InternalMetadataFolderImageProvider : ILocalImageFileProvider, IHasOrder
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using MediaBrowser.Controller.Entities;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

namespace MediaBrowser.Providers.All
namespace MediaBrowser.LocalMetadata.Images
{
public class LocalImageProvider : ILocalImageFileProvider
{
Expand Down
110 changes: 110 additions & 0 deletions MediaBrowser.LocalMetadata/MediaBrowser.LocalMetadata.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7EF9F3E0-697D-42F3-A08F-19DEB5F84392}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.LocalMetadata</RootNamespace>
<AssemblyName>MediaBrowser.LocalMetadata</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BaseXmlProvider.cs" />
<Compile Include="Images\CollectionFolderImageProvider.cs" />
<Compile Include="Images\EpisodeLocalImageProvider.cs" />
<Compile Include="Images\ImagesByNameImageProvider.cs" />
<Compile Include="Images\InternalMetadataFolderImageProvider.cs" />
<Compile Include="Images\LocalImageProvider.cs" />
<Compile Include="Parsers\BoxSetXmlParser.cs" />
<Compile Include="Parsers\EpisodeXmlParser.cs" />
<Compile Include="Parsers\GameSystemXmlParser.cs" />
<Compile Include="Parsers\GameXmlParser.cs" />
<Compile Include="Parsers\MovieXmlParser.cs" />
<Compile Include="Parsers\MusicVideoXmlParser.cs" />
<Compile Include="Parsers\SeasonXmlParser.cs" />
<Compile Include="Parsers\SeriesXmlParser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Providers\AdultVideoXmlProvider.cs" />
<Compile Include="Providers\AlbumXmlProvider.cs" />
<Compile Include="Providers\ArtistXmlProvider.cs" />
<Compile Include="Providers\BoxSetXmlProvider.cs" />
<Compile Include="Providers\ChannelXmlProvider.cs" />
<Compile Include="Providers\EpisodeXmlProvider.cs" />
<Compile Include="Providers\FolderXmlProvider.cs" />
<Compile Include="Providers\GameSystemXmlProvider.cs" />
<Compile Include="Providers\GameXmlProvider.cs" />
<Compile Include="Providers\MovieXmlProvider.cs" />
<Compile Include="Providers\MusicVideoXmlProvider.cs" />
<Compile Include="Providers\PersonXmlProvider.cs" />
<Compile Include="Providers\SeasonXmlProvider.cs" />
<Compile Include="Providers\SeriesXmlProvider.cs" />
<Compile Include="Providers\TrailerXmlProvider.cs" />
<Compile Include="Providers\VideoXmlProvider.cs" />
<Compile Include="Savers\AlbumXmlSaver.cs" />
<Compile Include="Savers\ArtistXmlSaver.cs" />
<Compile Include="Savers\BoxSetXmlSaver.cs" />
<Compile Include="Savers\ChannelXmlSaver.cs" />
<Compile Include="Savers\EpisodeXmlSaver.cs" />
<Compile Include="Savers\FolderXmlSaver.cs" />
<Compile Include="Savers\GameSystemXmlSaver.cs" />
<Compile Include="Savers\GameXmlSaver.cs" />
<Compile Include="Savers\MovieXmlSaver.cs" />
<Compile Include="Savers\PersonXmlSaver.cs" />
<Compile Include="Savers\SeasonXmlSaver.cs" />
<Compile Include="Savers\SeriesXmlSaver.cs" />
<Compile Include="Savers\XmlSaverHelpers.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
<Name>MediaBrowser.Common</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj">
<Project>{17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}</Project>
<Name>MediaBrowser.Controller</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
<Name>MediaBrowser.Model</Name>
</ProjectReference>
</ItemGroup>
<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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using MediaBrowser.Controller.Entities;
using System.Collections.Generic;
using System.Globalization;
using System.Xml;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using System.Collections.Generic;
using System.Globalization;
using System.Xml;

namespace MediaBrowser.Providers.BoxSets
namespace MediaBrowser.LocalMetadata.Parsers
{
public class BoxSetXmlParser : BaseItemXmlParser<BoxSet>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Xml;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;

namespace MediaBrowser.Providers.TV
namespace MediaBrowser.LocalMetadata.Parsers
{
/// <summary>
/// Class EpisodeXmlParser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using MediaBrowser.Controller.Entities;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;

namespace MediaBrowser.Providers.Games
namespace MediaBrowser.LocalMetadata.Parsers
{
public class GameSystemXmlParser : BaseItemXmlParser<GameSystem>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System.Globalization;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;

namespace MediaBrowser.Providers.Games
namespace MediaBrowser.LocalMetadata.Parsers
{
/// <summary>
/// Class EpisodeXmlParser
Expand Down
Loading

0 comments on commit 3d47b49

Please sign in to comment.