Merge pull request #1875 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-06-24 16:39:48 -04:00 committed by GitHub
commit 40bb17cd48
12 changed files with 87 additions and 15 deletions

View File

@ -34,7 +34,6 @@ namespace MediaBrowser.Api.UserLibrary
/// The _user manager /// The _user manager
/// </summary> /// </summary>
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IUserDataManager _userDataRepository;
/// <summary> /// <summary>
/// The _library manager /// The _library manager
@ -43,7 +42,6 @@ namespace MediaBrowser.Api.UserLibrary
private readonly ILocalizationManager _localization; private readonly ILocalizationManager _localization;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly ICollectionManager _collectionManager;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ItemsService" /> class. /// Initializes a new instance of the <see cref="ItemsService" /> class.
@ -58,10 +56,8 @@ namespace MediaBrowser.Api.UserLibrary
{ {
_userManager = userManager; _userManager = userManager;
_libraryManager = libraryManager; _libraryManager = libraryManager;
_userDataRepository = userDataRepository;
_localization = localization; _localization = localization;
_dtoService = dtoService; _dtoService = dtoService;
_collectionManager = collectionManager;
} }
/// <summary> /// <summary>

View File

@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
@ -151,6 +152,7 @@ namespace MediaBrowser.Providers.Music
} }
} }
private Regex _regex_http = new Regex("^http://");
private void PopulateImages(List<RemoteImageInfo> list, private void PopulateImages(List<RemoteImageInfo> list,
List<FanartArtistProvider.FanartArtistImage> images, List<FanartArtistProvider.FanartArtistImage> images,
ImageType type, ImageType type,
@ -178,7 +180,7 @@ namespace MediaBrowser.Providers.Music
Width = width, Width = width,
Height = height, Height = height,
ProviderName = Name, ProviderName = Name,
Url = url, Url = _regex_http.Replace(url, "https://", 1),
Language = i.lang Language = i.lang
}; };

View File

@ -14,6 +14,7 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
@ -149,6 +150,7 @@ namespace MediaBrowser.Providers.Music
PopulateImages(list, obj.musicarts, ImageType.Art, 500, 281); PopulateImages(list, obj.musicarts, ImageType.Art, 500, 281);
} }
private Regex _regex_http = new Regex("^http://");
private void PopulateImages(List<RemoteImageInfo> list, private void PopulateImages(List<RemoteImageInfo> list,
List<FanartArtistImage> images, List<FanartArtistImage> images,
ImageType type, ImageType type,
@ -176,7 +178,7 @@ namespace MediaBrowser.Providers.Music
Width = width, Width = width,
Height = height, Height = height,
ProviderName = Name, ProviderName = Name,
Url = url, Url = _regex_http.Replace(url, "https://", 1),
Language = i.lang Language = i.lang
}; };

View File

@ -15,6 +15,7 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
@ -160,6 +161,7 @@ namespace MediaBrowser.Providers.TV
PopulateImages(list, obj.showbackground, ImageType.Backdrop, 1920, 1080, seasonNumber); PopulateImages(list, obj.showbackground, ImageType.Backdrop, 1920, 1080, seasonNumber);
} }
private Regex _regex_http = new Regex("^http://");
private void PopulateImages(List<RemoteImageInfo> list, private void PopulateImages(List<RemoteImageInfo> list,
List<FanartSeriesProvider.Image> images, List<FanartSeriesProvider.Image> images,
ImageType type, ImageType type,
@ -194,7 +196,7 @@ namespace MediaBrowser.Providers.TV
Width = width, Width = width,
Height = height, Height = height,
ProviderName = Name, ProviderName = Name,
Url = url, Url = _regex_http.Replace(url, "https://", 1),
Language = i.lang Language = i.lang
}; };

View File

@ -17,6 +17,7 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
@ -162,6 +163,7 @@ namespace MediaBrowser.Providers.TV
PopulateImages(list, obj.tvposter, ImageType.Primary, 1000, 1426); PopulateImages(list, obj.tvposter, ImageType.Primary, 1000, 1426);
} }
private Regex _regex_http = new Regex("^http://");
private void PopulateImages(List<RemoteImageInfo> list, private void PopulateImages(List<RemoteImageInfo> list,
List<Image> images, List<Image> images,
ImageType type, ImageType type,
@ -194,7 +196,7 @@ namespace MediaBrowser.Providers.TV
Width = width, Width = width,
Height = height, Height = height,
ProviderName = Name, ProviderName = Name,
Url = url, Url = _regex_http.Replace(url, "https://", 1),
Language = i.lang Language = i.lang
}; };

View File

@ -1172,8 +1172,7 @@ namespace MediaBrowser.Server.Implementations.Channels
{ {
items = ApplyFilters(items, query.Filters, user); items = ApplyFilters(items, query.Filters, user);
var sortBy = query.SortBy.Length == 0 ? new[] { ItemSortBy.SortName } : query.SortBy; items = _libraryManager.Sort(items, user, query.SortBy, query.SortOrder ?? SortOrder.Ascending);
items = _libraryManager.Sort(items, user, sortBy, query.SortOrder ?? SortOrder.Ascending);
var all = items.ToList(); var all = items.ToList();
var totalCount = totalCountFromProvider ?? all.Count; var totalCount = totalCountFromProvider ?? all.Count;
@ -1321,6 +1320,21 @@ namespace MediaBrowser.Server.Implementations.Channels
item.Tags = info.Tags; item.Tags = info.Tags;
item.HomePageUrl = info.HomePageUrl; item.HomePageUrl = info.HomePageUrl;
} }
else
{
// Can't do this right now due to channels that utilize the server's metadata services
//if (item.Name != info.Name)
//{
// item.Name = info.Name;
// forceUpdate = true;
//}
//if (item.CommunityRating != info.CommunityRating)
//{
// item.CommunityRating = info.CommunityRating;
// forceUpdate = true;
//}
}
var hasArtists = item as IHasArtist; var hasArtists = item as IHasArtist;
if (hasArtists != null) if (hasArtists != null)

View File

@ -71,6 +71,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"create unique index if not exists UserDataDb.userdataindex on userdata (key, userId)", "create unique index if not exists UserDataDb.userdataindex on userdata (key, userId)",
"create index if not exists UserDataDb.userdataindex2 on userdata (key, userId, played)", "create index if not exists UserDataDb.userdataindex2 on userdata (key, userId, played)",
"create index if not exists UserDataDb.userdataindex3 on userdata (key, userId, playbackPositionTicks)",
"create index if not exists UserDataDb.userdataindex4 on userdata (key, userId, isFavorite)",
//pragmas //pragmas
"pragma temp_store = memory", "pragma temp_store = memory",

View File

@ -188,6 +188,48 @@ namespace MediaBrowser.XbmcMetadata.Parsers
break; break;
} }
case "displayseason":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
int rval;
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval))
{
if ((item.ParentIndexNumber ?? 0) == 0)
{
item.AirsBeforeSeasonNumber = rval;
}
}
}
break;
}
case "displayepisode":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
int rval;
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval))
{
if ((item.ParentIndexNumber ?? 0) == 0)
{
item.AirsBeforeEpisodeNumber = rval;
}
}
}
break;
}
default: default:
base.FetchDataFromXmlNode(reader, itemResult); base.FetchDataFromXmlNode(reader, itemResult);

View File

@ -72,11 +72,21 @@ namespace MediaBrowser.XbmcMetadata.Savers
{ {
writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture)); writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
} }
if (episode.AirsBeforeEpisodeNumber.HasValue)
{
writer.WriteElementString("displayepisode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
}
if (episode.AirsBeforeSeasonNumber.HasValue) if (episode.AirsBeforeSeasonNumber.HasValue)
{ {
writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture)); writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture));
} }
var season = episode.AiredSeasonNumber;
if (season.HasValue)
{
writer.WriteElementString("displayseason", season.Value.ToString(UsCulture));
}
if (episode.DvdEpisodeNumber.HasValue) if (episode.DvdEpisodeNumber.HasValue)
{ {
writer.WriteElementString("DVD_episodenumber", episode.DvdEpisodeNumber.Value.ToString(UsCulture)); writer.WriteElementString("DVD_episodenumber", episode.DvdEpisodeNumber.Value.ToString(UsCulture));

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.651</version> <version>3.0.652</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Emby 2013</copyright> <copyright>Copyright © Emby 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.651" /> <dependency id="MediaBrowser.Common" version="3.0.652" />
<dependency id="NLog" version="4.3.4" /> <dependency id="NLog" version="4.3.4" />
<dependency id="SimpleInjector" version="3.1.5" /> <dependency id="SimpleInjector" version="3.1.5" />
</dependencies> </dependencies>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.651</version> <version>3.0.652</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.651</version> <version>3.0.652</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description> <description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright> <copyright>Copyright © Emby 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.650" /> <dependency id="MediaBrowser.Common" version="3.0.652" />
<dependency id="Interfaces.IO" version="1.0.0.5" /> <dependency id="Interfaces.IO" version="1.0.0.5" />
</dependencies> </dependencies>
</metadata> </metadata>