simkl only likes snake_case
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
namespace Jellyfin.Plugin.Simkl.API.Objects
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Account.
|
|
||||||
/// </summary>
|
|
||||||
public class Account
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets account id.
|
|
||||||
/// </summary>
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets timezone.
|
|
||||||
/// </summary>
|
|
||||||
public string Timezone { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace Jellyfin.Plugin.Simkl.API.Objects
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Connections.
|
|
||||||
/// </summary>
|
|
||||||
public class Connections
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether facebook.
|
|
||||||
/// </summary>
|
|
||||||
public bool Facebook { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,11 +8,11 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the season number.
|
/// Gets or sets the season number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Number { get; set; }
|
public int? number { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the episodes.
|
/// Gets or sets the episodes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ShowEpisode[] Episodes { get; set; }
|
public ShowEpisode[] episodes { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets episode number.
|
/// Gets or sets episode number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Number { get; set; }
|
public int? number { get; set; }
|
||||||
// TODO: watched_at
|
// TODO: watched_at
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,26 +17,26 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets ids.
|
/// Gets or sets ids.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override SimklIds Ids { get; set; }
|
public override SimklIds ids { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the title.
|
/// Gets or sets the title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Title { get; set; }
|
public string title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the season.
|
/// Gets or sets the season.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Season { get; set; }
|
public int season { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the episode.
|
/// Gets or sets the episode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Episode { get; set; }
|
public int episode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets multipart.
|
/// Gets or sets multipart.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? Multipart { get; set; }
|
public bool? multipart { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,16 +8,16 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the file.
|
/// Gets or sets the file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string File { get; set; }
|
public string file { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the part.
|
/// Gets or sets the part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Part { get; set; }
|
public int? part { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the hash.
|
/// Gets or sets the hash.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Hash { get; set; }
|
public string hash { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,24 +14,24 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SimklHistory()
|
public SimklHistory()
|
||||||
{
|
{
|
||||||
Movies = new List<SimklMovie>();
|
movies = new List<SimklMovie>();
|
||||||
Shows = new List<SimklShow>();
|
shows = new List<SimklShow>();
|
||||||
Episodes = new List<SimklEpisode>();
|
episodes = new List<SimklEpisode>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets list of movies.
|
/// Gets or sets list of movies.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SimklMovie> Movies { get; set; }
|
public List<SimklMovie> movies { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the list of shows.
|
/// Gets or sets the list of shows.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SimklShow> Shows { get; set; }
|
public List<SimklShow> shows { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the list of episodes.
|
/// Gets or sets the list of episodes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SimklEpisode> Episodes { get; set; }
|
public List<SimklEpisode> episodes { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.Simkl.API.Objects
|
namespace Jellyfin.Plugin.Simkl.API.Objects
|
||||||
{
|
{
|
||||||
@@ -17,14 +17,25 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
{
|
{
|
||||||
foreach (var (key, value) in providerIds)
|
foreach (var (key, value) in providerIds)
|
||||||
{
|
{
|
||||||
var prop = GetType().GetProperty(key, BindingFlags.IgnoreCase);
|
if (key.Equals(nameof(simkl), StringComparison.OrdinalIgnoreCase))
|
||||||
if (prop.PropertyType == typeof(int?))
|
|
||||||
{
|
{
|
||||||
prop.SetValue(this, int.Parse(value, NumberStyles.Any, CultureInfo.InvariantCulture));
|
simkl = Convert.ToInt32(value, CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
else if (prop.PropertyType == typeof(string))
|
else if (key.Equals(nameof(imdb), StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
prop.SetValue(this, value);
|
imdb = value;
|
||||||
|
}
|
||||||
|
else if (key.Equals(nameof(slug), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
slug = value;
|
||||||
|
}
|
||||||
|
else if (key.Equals(nameof(netflix), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
netflix = value;
|
||||||
|
}
|
||||||
|
else if (key.Equals(nameof(tmdb), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
tmdb = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,26 +43,26 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets simkl.
|
/// Gets or sets simkl.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Simkl { get; set; }
|
public int? simkl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the imdb id.
|
/// Gets or sets the imdb id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Imdb { get; set; }
|
public string imdb { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the slug.
|
/// Gets or sets the slug.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Slug { get; set; }
|
public string slug { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the netflix id.
|
/// Gets or sets the netflix id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Netflix { get; set; }
|
public string netflix { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the TMDb id.
|
/// Gets or sets the TMDb id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Tmdb { get; set; }
|
public string tmdb { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,6 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets ids.
|
/// Gets or sets ids.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract SimklIds Ids { get; set; }
|
public abstract SimklIds ids { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,28 +15,28 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <param name="item">The base item dto.</param>
|
/// <param name="item">The base item dto.</param>
|
||||||
public SimklMovie(BaseItemDto item)
|
public SimklMovie(BaseItemDto item)
|
||||||
{
|
{
|
||||||
Title = item.OriginalTitle;
|
title = item.OriginalTitle;
|
||||||
Year = item.ProductionYear;
|
year = item.ProductionYear;
|
||||||
Ids = new SimklMovieIds(item.ProviderIds);
|
ids = new SimklMovieIds(item.ProviderIds);
|
||||||
WatchedAt = DateTime.UtcNow.ToString("yyyy-MM-dd HH\\:mm\\:ss", CultureInfo.InvariantCulture);
|
watched_at = DateTime.UtcNow.ToString("yyyy-MM-dd HH\\:mm\\:ss", CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the movie title.
|
/// Gets or sets the movie title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Title { get; set; }
|
public string title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the year.
|
/// Gets or sets the year.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Year { get; set; }
|
public int? year { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override SimklIds Ids { get; set; }
|
public override SimklIds ids { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets watched at.
|
/// Gets watched at.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WatchedAt { get; }
|
public string watched_at { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,31 +19,31 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the tvdb id.
|
/// Gets or sets the tvdb id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Tvdb { get; set; }
|
public int? tvdb { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the mal id.
|
/// Gets or sets the mal id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Mal { get; set; }
|
public int? mal { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the anidb id.
|
/// Gets or sets the anidb id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Anidb { get; set; }
|
public int? anidb { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the hulu id.
|
/// Gets or sets the hulu id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Hulu { get; set; }
|
public int? hulu { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the crunchyroll id.
|
/// Gets or sets the crunchyroll id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Crunchyroll { get; set; }
|
public int? crunchyroll { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the movie db id.
|
/// Gets or sets the movie db id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Moviedb { get; set; }
|
public string moviedb { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,19 +13,19 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <param name="mediaInfo">The media info.</param>
|
/// <param name="mediaInfo">The media info.</param>
|
||||||
public SimklShow(BaseItemDto mediaInfo)
|
public SimklShow(BaseItemDto mediaInfo)
|
||||||
{
|
{
|
||||||
Title = mediaInfo.SeriesName;
|
title = mediaInfo.SeriesName;
|
||||||
Ids = new SimklShowIds(mediaInfo.ProviderIds);
|
ids = new SimklShowIds(mediaInfo.ProviderIds);
|
||||||
Year = mediaInfo.ProductionYear;
|
year = mediaInfo.ProductionYear;
|
||||||
Seasons = new Season[]
|
seasons = new[]
|
||||||
{
|
{
|
||||||
new Season
|
new Season
|
||||||
{
|
{
|
||||||
Number = mediaInfo.ParentIndexNumber,
|
number = mediaInfo.ParentIndexNumber,
|
||||||
Episodes = new[]
|
episodes = new[]
|
||||||
{
|
{
|
||||||
new ShowEpisode
|
new ShowEpisode
|
||||||
{
|
{
|
||||||
Number = mediaInfo.IndexNumber
|
number = mediaInfo.IndexNumber
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,21 +35,21 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets title.
|
/// Gets or sets title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Title { get; set; }
|
public string title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets year.
|
/// Gets or sets year.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Year { get; set; }
|
public int? year { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets seasons.
|
/// Gets or sets seasons.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Season[] Seasons { get; set; }
|
public Season[] seasons { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets ids.
|
/// Gets or sets ids.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override SimklIds Ids { get; set; }
|
public override SimklIds ids { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,31 +19,31 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets tvdb.
|
/// Gets or sets tvdb.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Tvdb { get; set; }
|
public int? tvdb { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets mal.
|
/// Gets or sets mal.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Mal { get; set; }
|
public int? mal { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets anidb.
|
/// Gets or sets anidb.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Anidb { get; set; }
|
public int? anidb { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets hulu.
|
/// Gets or sets hulu.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Hulu { get; set; }
|
public int? hulu { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets crunchyroll.
|
/// Gets or sets crunchyroll.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? Crunchyroll { get; set; }
|
public int? crunchyroll { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets zap2it.
|
/// Gets or sets zap2it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Zap2It { get; set; }
|
public string zap2It { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
#pragma warning disable SA1300
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
#pragma warning disable SA1300
|
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.Simkl.API.Objects
|
namespace Jellyfin.Plugin.Simkl.API.Objects
|
||||||
{
|
{
|
||||||
@@ -12,37 +10,6 @@ namespace Jellyfin.Plugin.Simkl.API.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets name.
|
/// Gets or sets name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets joined at.
|
|
||||||
/// </summary>
|
|
||||||
[JsonPropertyName("joined_at")]
|
|
||||||
public DateTime joined_at { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets gender.
|
|
||||||
/// </summary>
|
|
||||||
public string Gender { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets avatar.
|
|
||||||
/// </summary>
|
|
||||||
public string Avatar { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets bio.
|
|
||||||
/// </summary>
|
|
||||||
public string Bio { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets loc.
|
|
||||||
/// </summary>
|
|
||||||
public string Loc { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets age.
|
|
||||||
/// </summary>
|
|
||||||
public string Age { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,16 +8,11 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets user.
|
/// Gets or sets user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public User User { get; set; }
|
public User user { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets account.
|
|
||||||
/// </summary>
|
|
||||||
public Account Account { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets error.
|
/// Gets or sets error.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Error { get; set; }
|
public string error { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
// Wontfix: Custom status codes
|
// Wontfix: Custom status codes
|
||||||
// "You don't get to pick your response code" - Luke (System Architect of Emby)
|
// "You don't get to pick your response code" - Luke (System Architect of Emby)
|
||||||
// https://emby.media/community/index.php?/topic/61889-wiki-issue-resultfactorythrowerror/
|
// https://emby.media/community/index.php?/topic/61889-wiki-issue-resultfactorythrowerror/
|
||||||
return new UserSettings { Error = "user_token_failed" };
|
return new UserSettings { error = "user_token_failed" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
var history = CreateHistoryFromItem(item);
|
var history = CreateHistoryFromItem(item);
|
||||||
var r = await SyncHistoryAsync(history, userToken).ConfigureAwait(false);
|
var r = await SyncHistoryAsync(history, userToken).ConfigureAwait(false);
|
||||||
_logger.LogDebug("Response: " + _json.SerializeToString(r));
|
_logger.LogDebug("Response: " + _json.SerializeToString(r));
|
||||||
if (history.Movies.Count == r.Added.Movies && history.Shows.Count == r.Added.Shows)
|
if (history.movies.Count == r.Added.Movies && history.shows.Count == r.Added.Shows)
|
||||||
{
|
{
|
||||||
return (true, item);
|
return (true, item);
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
r = await SyncHistoryAsync(history, userToken).ConfigureAwait(false);
|
r = await SyncHistoryAsync(history, userToken).ConfigureAwait(false);
|
||||||
_logger.LogDebug("Response: " + _json.SerializeToString(r));
|
_logger.LogDebug("Response: " + _json.SerializeToString(r));
|
||||||
|
|
||||||
return (history.Movies.Count == r.Added.Movies && history.Shows.Count == r.Added.Shows, item);
|
return (history.movies.Count == r.Added.Movies && history.shows.Count == r.Added.Shows, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -139,10 +139,10 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
/// <returns>Search file response.</returns>
|
/// <returns>Search file response.</returns>
|
||||||
private async Task<SearchFileResponse> GetFromFile(string filename)
|
private async Task<SearchFileResponse> GetFromFile(string filename)
|
||||||
{
|
{
|
||||||
var f = new SimklFile { File = filename };
|
var f = new SimklFile { file = filename };
|
||||||
_logger.LogInformation("Posting: " + _json.SerializeToString(f));
|
_logger.LogInformation("Posting: " + _json.SerializeToString(f));
|
||||||
using var r = new StreamReader(await Post("/search/file/", null, f).ConfigureAwait(false));
|
using var r = new StreamReader(await Post("/search/file/", null, f).ConfigureAwait(false));
|
||||||
var t = r.ReadToEnd();
|
var t = await r.ReadToEndAsync().ConfigureAwait(false);
|
||||||
_logger.LogDebug("Response: " + t);
|
_logger.LogDebug("Response: " + t);
|
||||||
return _json.DeserializeFromString<SearchFileResponse>(t);
|
return _json.DeserializeFromString<SearchFileResponse>(t);
|
||||||
}
|
}
|
||||||
@@ -166,9 +166,9 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
throw new InvalidDataException("type != movie (" + mo.Type + ")");
|
throw new InvalidDataException("type != movie (" + mo.Type + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
item.Name = mo.Movie.Title;
|
item.Name = mo.Movie.title;
|
||||||
item.ProductionYear = mo.Movie.Year;
|
item.ProductionYear = mo.Movie.year;
|
||||||
history.Movies.Add(mo.Movie);
|
history.movies.Add(mo.Movie);
|
||||||
}
|
}
|
||||||
else if (item.IsSeries == true || item.Type == "Episode")
|
else if (item.IsSeries == true || item.Type == "Episode")
|
||||||
{
|
{
|
||||||
@@ -177,12 +177,12 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
throw new InvalidDataException("type != episode (" + mo.Type + ")");
|
throw new InvalidDataException("type != episode (" + mo.Type + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
item.Name = mo.Episode.Title;
|
item.Name = mo.Episode.title;
|
||||||
item.SeriesName = mo.Show.Title;
|
item.SeriesName = mo.Show.title;
|
||||||
item.IndexNumber = mo.Episode.Episode;
|
item.IndexNumber = mo.Episode.episode;
|
||||||
item.ParentIndexNumber = mo.Episode.Season;
|
item.ParentIndexNumber = mo.Episode.season;
|
||||||
item.ProductionYear = mo.Show.Year;
|
item.ProductionYear = mo.Show.year;
|
||||||
history.Episodes.Add(mo.Episode);
|
history.episodes.Add(mo.Episode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (history, item);
|
return (history, item);
|
||||||
@@ -212,12 +212,12 @@ namespace Jellyfin.Plugin.Simkl.API
|
|||||||
|
|
||||||
if (item.IsMovie == true || item.Type == "Movie")
|
if (item.IsMovie == true || item.Type == "Movie")
|
||||||
{
|
{
|
||||||
history.Movies.Add(new SimklMovie(item));
|
history.movies.Add(new SimklMovie(item));
|
||||||
}
|
}
|
||||||
else if (item.IsSeries == true || item.Type == "Episode")
|
else if (item.IsSeries == true || item.Type == "Episode")
|
||||||
{
|
{
|
||||||
// TODO: TV Shows scrobbling (WIP)
|
// TODO: TV Shows scrobbling (WIP)
|
||||||
history.Shows.Add(new SimklShow(item));
|
history.shows.Add(new SimklShow(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
return history;
|
return history;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
ApiClient.updatePluginConfiguration(this.guid, this.configCache).then(Dashboard.processPluginConfigurationUpdateResult);
|
ApiClient.updatePluginConfiguration(this.guid, this.configCache).then(Dashboard.processPluginConfigurationUpdateResult);
|
||||||
},
|
},
|
||||||
populateOptionsContainer : async function(userConfig) {
|
populateOptionsContainer : async function(userConfig) {
|
||||||
$("#simklName").html(SimklAPI.getUserSettings(userConfig.Id).User.Name);
|
$("#simklName").html(SimklAPI.getUserSettings(userConfig.Id).user.name);
|
||||||
|
|
||||||
for (var key in userConfig) {
|
for (var key in userConfig) {
|
||||||
console.log(key, userConfig[key]);
|
console.log(key, userConfig[key]);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<FileVersion>1.0.0.0</FileVersion>
|
<FileVersion>1.0.0.0</FileVersion>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
<NoWarn>CA1707;CA1819</NoWarn>
|
<NoWarn>CA1707;CA1819;SA1300</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user