Skip to content

Commit

Permalink
Merge pull request Ombi-app#2401 from tidusjar/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tidusjar authored Jul 26, 2018
2 parents e42abd6 + 02adcda commit e621398
Show file tree
Hide file tree
Showing 55 changed files with 1,701 additions and 291 deletions.
79 changes: 79 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,84 @@
# Changelog

## (unreleased)

### **New Features**

- Updated the Emby availability checker to bring it more in line with what we do with Plex. [TidusJar]

- Added the ability to impersonate a user when using the API Key. This allows people to use the API and request as a certain user. #2363. [Jamie Rees]

- Added more background images and it will loop through the available ones. [Jamie Rees]

- Added chunk hashing to resolve #2330. [Jamie Rees]

- Added API at /api/v1/status/info to get branch and version information #2331. [Jamie Rees]

- Update to .net 2.1.1. [Jamie]

### **Fixes**

- Fix #2322 caused by continue statement inside try catch block. [Anojh]

- Fixed #2367. [TidusJar]

- Fixed the issue where you could not delete a user #2365. [TidusJar]

- Another attempt to fix #2366. [Jamie Rees]

- Fixed the Plex OAuth warning. [Jamie]

- Revert "Fixed Plex OAuth, should no longer show Insecure warning" [Jamie Rees]

- Fixed Plex OAuth, should no longer show Insecure warning. [Jamie Rees]

- Fixed the View On Emby URL since the Link changed #2368. [Jamie Rees]

- Fixed the issue where episodes were not being marked as available in the search #2367. [Jamie Rees]

- Fixed #2371. [Jamie Rees]

- Fixed collection issues in Emby #2366. [Jamie Rees]

- Do not delete the Emby Information every time we run, let's keep the content now. [Jamie Rees]

- Emby Improvements: Batch up the amount we get from the server. [Jamie Rees]

- Log errors when they are uncaught. [Jamie Rees]

- Fix unclosed table tags causing overflow #2322. [Anojh]

- This should now fix #2350. [Jamie]

- Improve the validation around the Application URL. [Jamie Rees]

- Fixed #2341. [Jamie Rees]

- Stop spamming errors when FanArt doesn't have the image. [Jamie Rees]

- Fixed #2338. [Jamie Rees]

- Removed some logging statements. [Jamie Rees]

- Fixed the api key being case sensative #2350. [Jamie Rees]

- Improved the Emby API #2230 Thanks Luke! [Jamie Rees]

- Revert. [Jamie Rees]

- Fixed a small error in the Mobile Notification Provider. [Jamie Rees]

- Minor style tweaks. [Randall Bruder]

- Downgrade to .net core 2.0. [Jamie Rees]

- Downgrade Microsoft.AspNetCore.All package back to 2.0.8. [Jamie Rees]

- Removed old code. [Jamie Rees]

- Swap out the old way of validating the API key with a real middlewear this time. [Jamie Rees]


## v3.0.3421 (2018-06-23)

### **New Features**
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ test: off
after_build:
- cmd: >-
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\windows.zip"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\windows.zip"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\osx.tar.gz"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\osx.tar.gz"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\linux.tar.gz"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\linux.tar.gz"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\linux-arm.tar.gz"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\linux-arm.tar.gz"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\windows-32bit.zip"
appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\windows-32bit.zip"
# appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\linux-arm64.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var csProj = "./src/Ombi/Ombi.csproj"; // Path to the project.csproj
var solutionFile = "Ombi.sln"; // Solution file if needed
GitVersion versionInfo = null;

var frameworkVer = "netcoreapp2.0";
var frameworkVer = "netcoreapp2.1";

var buildSettings = new DotNetCoreBuildSettings
{
Expand Down
40 changes: 31 additions & 9 deletions src/Ombi.Api.Emby/EmbyApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,31 @@ private static void AddEmbyHeaders(Request request)
request.AddContentHeader("Content-Type", "application/json");
}

public async Task<EmbyItemContainer<MovieInformation>> GetCollection(string mediaId, string apiKey, string userId, string baseUrl)
public async Task<EmbyItemContainer<EmbyMovie>> GetCollection(string mediaId, string apiKey, string userId, string baseUrl)
{
var request = new Request($"emby/users/{userId}/items?parentId={mediaId}", baseUrl, HttpMethod.Get);
AddHeaders(request, apiKey);

return await Api.Request<EmbyItemContainer<MovieInformation>>(request);
request.AddQueryString("Fields", "ProviderIds,Overview");

request.AddQueryString("VirtualItem", "False");

return await Api.Request<EmbyItemContainer<EmbyMovie>>(request);
}

public async Task<EmbyItemContainer<EmbyMovie>> GetAllMovies(string apiKey, string userId, string baseUri)
public async Task<EmbyItemContainer<EmbyMovie>> GetAllMovies(string apiKey, int startIndex, int count, string userId, string baseUri)
{
return await GetAll<EmbyMovie>("Movie", apiKey, userId, baseUri, true);
return await GetAll<EmbyMovie>("Movie", apiKey, userId, baseUri, true, startIndex, count);
}

public async Task<EmbyItemContainer<EmbyEpisodes>> GetAllEpisodes(string apiKey, string userId, string baseUri)
public async Task<EmbyItemContainer<EmbyEpisodes>> GetAllEpisodes(string apiKey, int startIndex, int count, string userId, string baseUri)
{
return await GetAll<EmbyEpisodes>("Episode", apiKey, userId, baseUri);
return await GetAll<EmbyEpisodes>("Episode", apiKey, userId, baseUri, false, startIndex, count);
}

public async Task<EmbyItemContainer<EmbySeries>> GetAllShows(string apiKey, string userId, string baseUri)
public async Task<EmbyItemContainer<EmbySeries>> GetAllShows(string apiKey, int startIndex, int count, string userId, string baseUri)
{
return await GetAll<EmbySeries>("Series", apiKey, userId, baseUri);
return await GetAll<EmbySeries>("Series", apiKey, userId, baseUri, false, startIndex, count);
}

public async Task<SeriesInformation> GetSeriesInformation(string mediaId, string apiKey, string userId, string baseUrl)
Expand Down Expand Up @@ -145,7 +149,25 @@ private async Task<EmbyItemContainer<T>> GetAll<T>(string type, string apiKey, s
request.AddQueryString("IncludeItemTypes", type);
request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview" : "ProviderIds");

request.AddQueryString("VirtualItem","False");
request.AddQueryString("VirtualItem", "False");

AddHeaders(request, apiKey);


var obj = await Api.Request<EmbyItemContainer<T>>(request);
return obj;
}
private async Task<EmbyItemContainer<T>> GetAll<T>(string type, string apiKey, string userId, string baseUri, bool includeOverview, int startIndex, int count)
{
var request = new Request($"emby/users/{userId}/items", baseUri, HttpMethod.Get);

request.AddQueryString("Recursive", true.ToString());
request.AddQueryString("IncludeItemTypes", type);
request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview" : "ProviderIds");
request.AddQueryString("startIndex", startIndex.ToString());
request.AddQueryString("limit", count.ToString());

request.AddQueryString("VirtualItem", "False");

AddHeaders(request, apiKey);

Expand Down
15 changes: 10 additions & 5 deletions src/Ombi.Api.Emby/IEmbyApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ public interface IEmbyApi
Task<EmbyUser> LogIn(string username, string password, string apiKey, string baseUri);
Task<EmbyConnectUser> LoginConnectUser(string username, string password);

Task<EmbyItemContainer<EmbyMovie>> GetAllMovies(string apiKey, string userId, string baseUri);
Task<EmbyItemContainer<EmbyEpisodes>> GetAllEpisodes(string apiKey, string userId, string baseUri);
Task<EmbyItemContainer<EmbySeries>> GetAllShows(string apiKey, string userId, string baseUri);
Task<EmbyItemContainer<EmbyMovie>> GetAllMovies(string apiKey, int startIndex, int count, string userId,
string baseUri);

Task<EmbyItemContainer<MovieInformation>> GetCollection(string mediaId, string apiKey, string userId,
string baseUrl);
Task<EmbyItemContainer<EmbyEpisodes>> GetAllEpisodes(string apiKey, int startIndex, int count, string userId,
string baseUri);

Task<EmbyItemContainer<EmbySeries>> GetAllShows(string apiKey, int startIndex, int count, string userId,
string baseUri);

Task<EmbyItemContainer<EmbyMovie>> 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);
Expand Down
3 changes: 1 addition & 2 deletions src/Ombi.Api.Plex/IPlexApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public interface IPlexApi
Task<PlexFriends> GetUsers(string authToken);
Task<PlexAccount> GetAccount(string authToken);
Task<PlexMetadata> GetRecentlyAdded(string authToken, string uri, string sectionId);
Task<OAuthPin> CreatePin();
Task<OAuthPin> GetPin(int pinId);
Uri GetOAuthUrl(int pinId, string code, string applicationUrl, bool wizard);
Task<Uri> GetOAuthUrl(int pinId, string code, string applicationUrl, bool wizard);
}
}
Loading

0 comments on commit e621398

Please sign in to comment.