Skip to content

Commit

Permalink
add hevc cuvid
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Jun 12, 2017
1 parent e92c770 commit 5dd8a62
Show file tree
Hide file tree
Showing 28 changed files with 50 additions and 162 deletions.
12 changes: 1 addition & 11 deletions Emby.Server.Implementations/Dto/DtoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,18 +1058,8 @@ private void AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem owner, D
dto.CommunityRating = item.CommunityRating;
}

//if (item.IsFolder)
//{
// var folder = (Folder)item;

// if (fields.Contains(ItemFields.IndexOptions))
// {
// dto.IndexOptions = folder.IndexByOptionStrings.ToArray();
// }
//}

var supportsPlaceHolders = item as ISupportsPlaceHolders;
if (supportsPlaceHolders != null)
if (supportsPlaceHolders != null && supportsPlaceHolders.IsPlaceHolder)
{
dto.IsPlaceHolder = supportsPlaceHolders.IsPlaceHolder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInf
var imagesWithText = allImages.Where(i => string.Equals(i.text, "yes", StringComparison.OrdinalIgnoreCase)).ToList();
var imagesWithoutText = allImages.Where(i => string.Equals(i.text, "no", StringComparison.OrdinalIgnoreCase)).ToList();

double desiredAspect = IsMovie(programEntry) ? 0.666666667 : wideAspect;
double desiredAspect = 0.666666667;

programEntry.primaryImage = GetProgramImage(ApiUrl, imagesWithText, true, desiredAspect) ??
GetProgramImage(ApiUrl, allImages, true, desiredAspect);
Expand Down
17 changes: 10 additions & 7 deletions Emby.Server.Implementations/LiveTv/LiveTvManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ private Tuple<LiveTvProgram, bool, bool> GetProgram(ProgramInfo info, Dictionary
else
{
// Increment this whenver some internal change deems it necessary
var etag = info.Etag + "4";
var etag = info.Etag + "5";

if (!string.Equals(etag, item.ExternalEtag, StringComparison.OrdinalIgnoreCase))
{
Expand Down Expand Up @@ -1422,13 +1422,16 @@ private async Task<Tuple<List<Guid>, List<Guid>>> RefreshChannelsInternal(ILiveT
await _libraryManager.UpdateItem(program, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
}

foreach (var program in newPrograms)
if (!(service is EmbyTV.EmbyTV))
{
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
}
foreach (var program in updatedPrograms)
{
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
foreach (var program in newPrograms)
{
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
}
foreach (var program in updatedPrograms)
{
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
}
}

currentChannel.IsMovie = isMovie;
Expand Down
1 change: 0 additions & 1 deletion Emby.Server.Implementations/Session/SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,6 @@ private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource)
dtoOptions.Fields.Remove(ItemFields.DisplayPreferencesId);
dtoOptions.Fields.Remove(ItemFields.Etag);
dtoOptions.Fields.Remove(ItemFields.ExternalEtag);
dtoOptions.Fields.Remove(ItemFields.IndexOptions);
dtoOptions.Fields.Remove(ItemFields.InheritedParentalRatingValue);
dtoOptions.Fields.Remove(ItemFields.ItemCounts);
dtoOptions.Fields.Remove(ItemFields.Keywords);
Expand Down
27 changes: 0 additions & 27 deletions MediaBrowser.Controller/Entities/Folder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,33 +211,6 @@ public void RemoveChild(BaseItem item)
item.SetParent(null);
}

/// <summary>
/// Returns the valid set of index by options for this folder type.
/// Override or extend to modify.
/// </summary>
/// <returns>Dictionary{System.StringFunc{UserIEnumerable{BaseItem}}}.</returns>
protected virtual IEnumerable<string> GetIndexByOptions()
{
return new List<string> {
{"None"},
{"Performer"},
{"Genre"},
{"Director"},
{"Year"},
{"Studio"}
};
}

/// <summary>
/// Get the list of indexy by choices for this folder (localized).
/// </summary>
/// <value>The index by option strings.</value>
[IgnoreDataMember]
public IEnumerable<string> IndexByOptionStrings
{
get { return GetIndexByOptions(); }
}

/// <summary>
/// Gets the actual children.
/// </summary>
Expand Down
11 changes: 0 additions & 11 deletions MediaBrowser.Controller/Entities/TV/Season.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ public string FindSeriesSortName()
return series == null ? SeriesName : series.SortName;
}

// Genre, Rating and Stuido will all be the same
protected override IEnumerable<string> GetIndexByOptions()
{
return new List<string> {
{"None"},
{"Performer"},
{"Director"},
{"Year"},
};
}

public override List<string> GetUserDataKeys()
{
var list = base.GetUserDataKeys();
Expand Down
11 changes: 0 additions & 11 deletions MediaBrowser.Controller/Entities/TV/Series.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,6 @@ public List<Guid> GetTrailerIds()
return list;
}

// Studio, Genre and Rating will all be the same so makes no sense to index by these
protected override IEnumerable<string> GetIndexByOptions()
{
return new List<string> {
{"None"},
{"Performer"},
{"Director"},
{"Year"},
};
}

[IgnoreDataMember]
public bool ContainsEpisodesWithoutSeasonFolders
{
Expand Down
7 changes: 6 additions & 1 deletion MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ public override List<string> GetUserDataKeys()

return value;
}
else
{
double value = 2;
value /= 3;

return null;
return value;
}
}

[IgnoreDataMember]
Expand Down
3 changes: 2 additions & 1 deletion MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ private List<string> GetDecoders(string encoderAppPath)
"hevc_qsv",
"mpeg2_qsv",
"vc1_qsv",
"h264_cuvid"
"h264_cuvid",
"hevc_cuvid"
};

foreach (var codec in required)
Expand Down
5 changes: 0 additions & 5 deletions MediaBrowser.Model/Querying/ItemFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ public enum ItemFields
/// </summary>
HomePageUrl,

/// <summary>
/// The fields that the server supports indexing on
/// </summary>
IndexOptions,

/// <summary>
/// The item counts
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion MediaBrowser.Providers/MediaBrowser.Providers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<Compile Include="MediaInfo\SubtitleDownloader.cs" />
<Compile Include="MediaInfo\SubtitleResolver.cs" />
<Compile Include="MediaInfo\SubtitleScheduledTask.cs" />
<Compile Include="Movies\LiveTvMovieDbProvider.cs" />
<Compile Include="Movies\MovieDbTrailerProvider.cs" />
<Compile Include="Movies\MovieExternalIds.cs" />
<Compile Include="Movies\GenericMovieDbInfo.cs" />
Expand Down
38 changes: 0 additions & 38 deletions MediaBrowser.Providers/Movies/LiveTvMovieDbProvider.cs

This file was deleted.

7 changes: 0 additions & 7 deletions MediaBrowser.Providers/Movies/MovieDbImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ public static string ProviderName

public bool Supports(IHasImages item)
{
// Supports images for tv movies
var tvProgram = item as LiveTvProgram;
if (tvProgram != null && tvProgram.IsMovie)
{
return true;
}

return item is Movie || item is MusicVideo || item is Trailer;
}

Expand Down
7 changes: 0 additions & 7 deletions MediaBrowser.Providers/Omdb/OmdbImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ public string Name

public bool Supports(IHasImages item)
{
// Supports images for tv movies
var tvProgram = item as LiveTvProgram;
if (tvProgram != null && tvProgram.IsMovie)
{
return true;
}

return item is Movie || item is Trailer || item is Episode;
}

Expand Down
21 changes: 1 addition & 20 deletions MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace MediaBrowser.Providers.Omdb
{
public class OmdbItemProvider : IRemoteMetadataProvider<Series, SeriesInfo>,
IRemoteMetadataProvider<Movie, MovieInfo>, IRemoteMetadataProvider<Trailer, TrailerInfo>, IRemoteMetadataProvider<LiveTvProgram, LiveTvProgramLookupInfo>
IRemoteMetadataProvider<Movie, MovieInfo>, IRemoteMetadataProvider<Trailer, TrailerInfo>
{
private readonly IJsonSerializer _jsonSerializer;
private readonly IHttpClient _httpClient;
Expand Down Expand Up @@ -51,16 +51,6 @@ public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(MovieInfo searchIn
return GetSearchResults(searchInfo, "movie", cancellationToken);
}

public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(LiveTvProgramLookupInfo searchInfo, CancellationToken cancellationToken)
{
if (!searchInfo.IsMovie)
{
return Task.FromResult<IEnumerable<RemoteSearchResult>>(new List<RemoteSearchResult>());
}

return GetSearchResults(searchInfo, "movie", cancellationToken);
}

public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(ItemLookupInfo searchInfo, string type, CancellationToken cancellationToken)
{
return GetSearchResultsInternal(searchInfo, type, true, cancellationToken);
Expand Down Expand Up @@ -230,15 +220,6 @@ public async Task<MetadataResult<Series>> GetMetadata(SeriesInfo info, Cancellat
return result;
}

public Task<MetadataResult<LiveTvProgram>> GetMetadata(LiveTvProgramLookupInfo info, CancellationToken cancellationToken)
{
if (!info.IsMovie)
{
return Task.FromResult(new MetadataResult<LiveTvProgram>());
}
return GetMovieResult<LiveTvProgram>(info, cancellationToken);
}

public Task<MetadataResult<Movie>> GetMetadata(MovieInfo info, CancellationToken cancellationToken)
{
return GetMovieResult<Movie>(info, cancellationToken);
Expand Down
Loading

0 comments on commit 5dd8a62

Please sign in to comment.