aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-02 11:33:20 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-02 11:33:20 -0400
commit067479f2d1dcf40127ada01fbd452040a14ae877 (patch)
tree2e789d7206adb016f22d84db922f0703a856fd21
parent67ff9f59a1972b483c3a4728b7a09064939847ec (diff)
update ffmpeg info
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs45
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs27
-rw-r--r--MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs4
3 files changed, 64 insertions, 12 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs
index ed3f2c633..96b307064 100644
--- a/MediaBrowser.Api/Library/LibraryService.cs
+++ b/MediaBrowser.Api/Library/LibraryService.cs
@@ -231,6 +231,17 @@ namespace MediaBrowser.Api.Library
public string TvdbId { get; set; }
}
+ [Route("/Library/Movies/Added", "POST", Summary = "Reports that new movies have been added by an external source")]
+ [Route("/Library/Movies/Updated", "POST", Summary = "Reports that new movies have been added by an external source")]
+ [Authenticated]
+ public class PostUpdatedMovies : IReturnVoid
+ {
+ [ApiMember(Name = "TmdbId", Description = "Tmdb Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string TmdbId { get; set; }
+ [ApiMember(Name = "ImdbId", Description = "Imdb Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string ImdbId { get; set; }
+ }
+
[Route("/Items/{Id}/Download", "GET", Summary = "Downloads item media")]
[Authenticated(Roles = "download")]
public class GetDownload
@@ -444,6 +455,40 @@ namespace MediaBrowser.Api.Library
}
}
+ public void Post(PostUpdatedMovies request)
+ {
+ var movies = _libraryManager.GetItems(new InternalItemsQuery
+ {
+ IncludeItemTypes = new[] { typeof(Movie).Name }
+
+ }).Items;
+
+ if (!string.IsNullOrWhiteSpace(request.ImdbId))
+ {
+ movies = movies.Where(i => string.Equals(request.ImdbId, i.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).ToArray();
+ }
+ else if (!string.IsNullOrWhiteSpace(request.TmdbId))
+ {
+ movies = movies.Where(i => string.Equals(request.TmdbId, i.GetProviderId(MetadataProviders.Tmdb), StringComparison.OrdinalIgnoreCase)).ToArray();
+ }
+ else
+ {
+ movies = new BaseItem[] { };
+ }
+
+ if (movies.Length > 0)
+ {
+ foreach (var item in movies)
+ {
+ _libraryMonitor.ReportFileSystemChanged(item.Path);
+ }
+ }
+ else
+ {
+ Task.Run(() => _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None));
+ }
+ }
+
public object Get(GetDownload request)
{
var item = _libraryManager.GetItemById(request.Id);
diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
index b473444ac..602bc4876 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -85,16 +85,23 @@ namespace MediaBrowser.Server.Implementations.Session
async void _httpServer_WebSocketConnecting(object sender, WebSocketConnectingEventArgs e)
{
- var token = e.QueryString["api_key"];
- if (!string.IsNullOrWhiteSpace(token))
- {
- var session = await GetSession(e.QueryString, e.Endpoint).ConfigureAwait(false);
-
- if (session == null)
- {
- //e.AllowConnection = false;
- }
- }
+ //var token = e.QueryString["api_key"];
+ //if (!string.IsNullOrWhiteSpace(token))
+ //{
+ // try
+ // {
+ // var session = await GetSession(e.QueryString, e.Endpoint).ConfigureAwait(false);
+
+ // if (session == null)
+ // {
+ // e.AllowConnection = false;
+ // }
+ // }
+ // catch (Exception ex)
+ // {
+ // _logger.ErrorException("Error getting session info", ex);
+ // }
+ //}
}
private Task<SessionInfo> GetSession(NameValueCollection queryString, string remoteEndpoint)
diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs
index 2d4ed94f7..2910479ef 100644
--- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs
+++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs
@@ -84,13 +84,13 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
return new[]
{
"http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20150717-git-8250943-win64-static.7z",
- "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20150717-git-8250943-win64-static.7z"
+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20150901-git-b54e03c-win64-static.7z"
};
case Architecture.X86:
return new[]
{
"http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20150717-git-8250943-win32-static.7z",
- "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20150717-git-8250943-win32-static.7z"
+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20150901-git-b54e03c-win32-static.7z"
};
}
break;