mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
add tvdb and games db to xml savers
This commit is contained in:
parent
c1ad234b79
commit
44493dca1d
@ -275,11 +275,9 @@ namespace MediaBrowser.Controller.Dto
|
|||||||
dto.DisplayPreferencesId = ((Folder)item).GetDisplayPreferencesId(user.Id).ToString();
|
dto.DisplayPreferencesId = ((Folder)item).GetDisplayPreferencesId(user.Id).ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
var addUserData = fields.Contains(ItemFields.UserData);
|
|
||||||
|
|
||||||
if (item.IsFolder)
|
if (item.IsFolder)
|
||||||
{
|
{
|
||||||
if (fields.Contains(ItemFields.ItemCounts) || addUserData)
|
if (fields.Contains(ItemFields.ItemCounts))
|
||||||
{
|
{
|
||||||
var folder = (Folder)item;
|
var folder = (Folder)item;
|
||||||
|
|
||||||
@ -290,16 +288,13 @@ namespace MediaBrowser.Controller.Dto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addUserData)
|
var userData = _userDataRepository.GetUserData(user.Id, item.GetUserDataKey());
|
||||||
|
|
||||||
|
dto.UserData = GetUserItemDataDto(userData);
|
||||||
|
|
||||||
|
if (item.IsFolder)
|
||||||
{
|
{
|
||||||
var userData = _userDataRepository.GetUserData(user.Id, item.GetUserDataKey());
|
dto.UserData.Played = dto.PlayedPercentage.HasValue && dto.PlayedPercentage.Value >= 100;
|
||||||
|
|
||||||
dto.UserData = GetUserItemDataDto(userData);
|
|
||||||
|
|
||||||
if (item.IsFolder)
|
|
||||||
{
|
|
||||||
dto.UserData.Played = dto.PlayedPercentage.HasValue && dto.PlayedPercentage.Value >= 100;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -992,7 +992,12 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var rating = CustomRating ?? OfficialRating;
|
var rating = CustomRating;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(rating))
|
||||||
|
{
|
||||||
|
rating = OfficialRating;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(rating))
|
if (string.IsNullOrEmpty(rating))
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Common.Progress;
|
using MediaBrowser.Common.Progress;
|
||||||
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.IO;
|
using MediaBrowser.Controller.IO;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Localization;
|
using MediaBrowser.Controller.Localization;
|
||||||
@ -139,6 +140,11 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
if (this is Series)
|
||||||
|
{
|
||||||
|
return base.OfficialRating;
|
||||||
|
}
|
||||||
|
|
||||||
return !string.IsNullOrEmpty(base.OfficialRating) ? base.OfficialRating : "None";
|
return !string.IsNullOrEmpty(base.OfficialRating) ? base.OfficialRating : "None";
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
|
@ -464,6 +464,22 @@ namespace MediaBrowser.Controller.Providers
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "TvDbId":
|
||||||
|
var tvdbId = reader.ReadElementContentAsString();
|
||||||
|
if (!string.IsNullOrWhiteSpace(tvdbId))
|
||||||
|
{
|
||||||
|
item.SetProviderId(MetadataProviders.Tvdb, tvdbId);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "GamesDbId":
|
||||||
|
var gamesdbId = reader.ReadElementContentAsString();
|
||||||
|
if (!string.IsNullOrWhiteSpace(gamesdbId))
|
||||||
|
{
|
||||||
|
item.SetProviderId(MetadataProviders.Gamesdb, gamesdbId);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case "MusicbrainzId":
|
case "MusicbrainzId":
|
||||||
var mbz = reader.ReadElementContentAsString();
|
var mbz = reader.ReadElementContentAsString();
|
||||||
if (!string.IsNullOrWhiteSpace(mbz))
|
if (!string.IsNullOrWhiteSpace(mbz))
|
||||||
|
@ -73,7 +73,8 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
"LockData",
|
"LockData",
|
||||||
"Trailer",
|
"Trailer",
|
||||||
"CriticRating",
|
"CriticRating",
|
||||||
"CriticRatingSummary"
|
"CriticRatingSummary",
|
||||||
|
"GamesDbId"
|
||||||
});
|
});
|
||||||
|
|
||||||
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
||||||
@ -269,6 +270,16 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
builder.Append("<TMDbId>" + SecurityElement.Escape(tmdb) + "</TMDbId>");
|
builder.Append("<TMDbId>" + SecurityElement.Escape(tmdb) + "</TMDbId>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(item is Series))
|
||||||
|
{
|
||||||
|
var tvdb = item.GetProviderId(MetadataProviders.Tvdb);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(tvdb))
|
||||||
|
{
|
||||||
|
builder.Append("<TvDbId>" + SecurityElement.Escape(tvdb) + "</TvDbId>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var tvcom = item.GetProviderId(MetadataProviders.Tvcom);
|
var tvcom = item.GetProviderId(MetadataProviders.Tvcom);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(tvcom))
|
if (!string.IsNullOrEmpty(tvcom))
|
||||||
@ -290,6 +301,13 @@ namespace MediaBrowser.Providers.Savers
|
|||||||
builder.Append("<MusicbrainzId>" + SecurityElement.Escape(mbz) + "</MusicbrainzId>");
|
builder.Append("<MusicbrainzId>" + SecurityElement.Escape(mbz) + "</MusicbrainzId>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var gamesdb = item.GetProviderId(MetadataProviders.Gamesdb);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(gamesdb))
|
||||||
|
{
|
||||||
|
builder.Append("<GamesDbId>" + SecurityElement.Escape(gamesdb) + "</GamesDbId>");
|
||||||
|
}
|
||||||
|
|
||||||
var tmdbCollection = item.GetProviderId(MetadataProviders.TmdbCollection);
|
var tmdbCollection = item.GetProviderId(MetadataProviders.TmdbCollection);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(tmdbCollection))
|
if (!string.IsNullOrEmpty(tmdbCollection))
|
||||||
|
@ -637,10 +637,9 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instructs the server to perform a pending kernel reload or app restart.
|
* Instructs the server to perform a restart.
|
||||||
* If a restart is not currently required, nothing will happen.
|
|
||||||
*/
|
*/
|
||||||
self.performPendingRestart = function () {
|
self.restartServer = function () {
|
||||||
|
|
||||||
var url = self.getUrl("System/Restart");
|
var url = self.getUrl("System/Restart");
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.144" targetFramework="net45" />
|
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.145" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Common" version="3.9.54" targetFramework="net45" />
|
<package id="ServiceStack.Common" version="3.9.54" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Text" version="3.9.54" targetFramework="net45" />
|
<package id="ServiceStack.Text" version="3.9.54" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
Loading…
Reference in New Issue
Block a user