Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
269 changed files
with
10,159 additions
and
1,019 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Ombi.Api.Jellyfin.Models; | ||
using Ombi.Api.Jellyfin.Models.Media.Tv; | ||
using Ombi.Api.Jellyfin.Models.Movie; | ||
|
||
namespace Ombi.Api.Jellyfin | ||
{ | ||
public interface IBaseJellyfinApi | ||
{ | ||
Task<JellyfinSystemInfo> GetSystemInformation(string apiKey, string baseUrl); | ||
Task<List<JellyfinUser>> GetUsers(string baseUri, string apiKey); | ||
Task<JellyfinUser> LogIn(string username, string password, string apiKey, string baseUri); | ||
|
||
Task<JellyfinItemContainer<JellyfinMovie>> GetAllMovies(string apiKey, int startIndex, int count, string userId, | ||
string baseUri); | ||
|
||
Task<JellyfinItemContainer<JellyfinEpisodes>> GetAllEpisodes(string apiKey, int startIndex, int count, string userId, | ||
string baseUri); | ||
|
||
Task<JellyfinItemContainer<JellyfinSeries>> GetAllShows(string apiKey, int startIndex, int count, string userId, | ||
string baseUri); | ||
|
||
Task<JellyfinItemContainer<JellyfinMovie>> GetCollection(string mediaId, | ||
string apiKey, string userId, string baseUrl); | ||
|
||
Task<SeriesInformation> GetSeriesInformation(string mediaId, string apiKey, string userId, string baseUrl); | ||
Task<MovieInformation> GetMovieInformation(string mediaId, string apiKey, string userId, string baseUrl); | ||
Task<EpisodeInformation> GetEpisodeInformation(string mediaId, string apiKey, string userId, string baseUrl); | ||
Task<PublicInfo> GetPublicInformation(string baseUrl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Threading.Tasks; | ||
using Ombi.Api.Jellyfin.Models; | ||
|
||
namespace Ombi.Api.Jellyfin | ||
{ | ||
public interface IJellyfinApi : IBaseJellyfinApi | ||
{ | ||
Task<JellyfinConnectUser> LoginConnectUser(string username, string password); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Ombi.Api; | ||
using Ombi.Core.Settings; | ||
using Ombi.Core.Settings.Models.External; | ||
using System.Threading.Tasks; | ||
|
||
namespace Ombi.Api.Jellyfin | ||
{ | ||
public class JellyfinApiFactory : IJellyfinApiFactory | ||
{ | ||
private readonly ISettingsService<JellyfinSettings> _jellyfinSettings; | ||
private readonly IApi _api; | ||
|
||
// TODO, if we need to derive futher, need to rework | ||
public JellyfinApiFactory(ISettingsService<JellyfinSettings> jellyfinSettings, IApi api) | ||
{ | ||
_jellyfinSettings = jellyfinSettings; | ||
_api = api; | ||
} | ||
|
||
public async Task<IJellyfinApi> CreateClient() | ||
{ | ||
var settings = await _jellyfinSettings.GetSettingsAsync(); | ||
return CreateClient(settings); | ||
} | ||
|
||
public IJellyfinApi CreateClient(JellyfinSettings settings) | ||
{ | ||
return new JellyfinApi(_api); | ||
} | ||
} | ||
|
||
public interface IJellyfinApiFactory | ||
{ | ||
Task<IJellyfinApi> CreateClient(); | ||
IJellyfinApi CreateClient(JellyfinSettings settings); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#region Copyright | ||
// /************************************************************************ | ||
// Copyright (c) 2017 Jamie Rees | ||
// File: JellyfinConfiguration.cs | ||
// Created By: Jamie Rees | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// ************************************************************************/ | ||
#endregion | ||
namespace Ombi.Api.Jellyfin.Models | ||
{ | ||
public class JellyfinConfiguration | ||
{ | ||
public bool PlayDefaultAudioTrack { get; set; } | ||
public bool DisplayMissingEpisodes { get; set; } | ||
public bool DisplayUnairedEpisodes { get; set; } | ||
public object[] GroupedFolders { get; set; } | ||
public string SubtitleMode { get; set; } | ||
public bool DisplayCollectionsView { get; set; } | ||
public bool EnableLocalPassword { get; set; } | ||
public object[] OrderedViews { get; set; } | ||
public object[] LatestItemsExcludes { get; set; } | ||
public bool HidePlayedInLatest { get; set; } | ||
public bool RememberAudioSelections { get; set; } | ||
public bool RememberSubtitleSelections { get; set; } | ||
public bool EnableNextEpisodeAutoPlay { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#region Copyright | ||
// /************************************************************************ | ||
// Copyright (c) 2017 Jamie Rees | ||
// File: JellyfinConnectUser.cs | ||
// Created By: Jamie Rees | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// ************************************************************************/ | ||
#endregion | ||
namespace Ombi.Api.Jellyfin.Models | ||
{ | ||
public class JellyfinConnectUser | ||
{ | ||
public string AccessToken { get; set; } | ||
public User User { get; set; } | ||
} | ||
|
||
public class User | ||
{ | ||
public string Id { get; set; } | ||
public string Name { get; set; } | ||
public string DisplayName { get; set; } | ||
public string Email { get; set; } | ||
public string IsActive { get; set; } | ||
public string ImageUrl { get; set; } | ||
public object IsSupporter { get; set; } | ||
public object ExpDate { get; set; } | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Ombi.Api.Jellyfin.Models | ||
{ | ||
public class JellyfinItemContainer<T> | ||
{ | ||
public List<T> Items { get; set; } | ||
public int TotalRecordCount { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Ombi.Api.Jellyfin.Models | ||
{ | ||
public enum JellyfinMediaType | ||
{ | ||
Movie = 0, | ||
Series = 1, | ||
Music = 2, | ||
Episode = 3 | ||
} | ||
} |
Oops, something went wrong.