aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-03-18 02:36:58 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-03-18 02:36:58 -0400
commitb84f178467e347e1d6d977e84259c713c06001f5 (patch)
treee6ff106d73d615971e2579eb43b8360502da9a25
parent79dc9f29d9bffae50a1fb24d8650d0ea73a73a45 (diff)
update plugin pages
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs8
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs7
-rw-r--r--MediaBrowser.Controller/Entities/Book.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Trailer.cs1
-rw-r--r--MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs2
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs8
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs33
-rw-r--r--MediaBrowser.WebDashboard/Api/PackageCreator.cs35
8 files changed, 79 insertions, 17 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index decd19602..82931e11e 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -201,10 +201,10 @@ namespace MediaBrowser.Api.Library
var rootFolderPath = _appPaths.DefaultUserViewsPath;
var virtualFolderPath = Path.Combine(rootFolderPath, name);
-
- if (_fileSystem.DirectoryExists(virtualFolderPath))
+ while (_fileSystem.DirectoryExists(virtualFolderPath))
{
- throw new ArgumentException("There is already a media library with the name " + name + ".");
+ name += "1";
+ virtualFolderPath = Path.Combine(rootFolderPath, name);
}
if (request.Paths != null)
@@ -236,7 +236,7 @@ namespace MediaBrowser.Api.Library
{
foreach (var path in request.Paths)
{
- LibraryHelpers.AddMediaPath(_fileSystem, request.Name, path, _appPaths);
+ LibraryHelpers.AddMediaPath(_fileSystem, name, path, _appPaths);
}
}
}
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index bd4ede466..4106c7197 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -57,7 +57,9 @@ namespace MediaBrowser.Controller.Entities
public static string ThemeSongFilename = "theme";
public static string ThemeVideosFolderName = "backdrops";
+ [IgnoreDataMember]
public string PreferredMetadataCountryCode { get; set; }
+ [IgnoreDataMember]
public string PreferredMetadataLanguage { get; set; }
public List<ItemImageInfo> ImageInfos { get; set; }
@@ -88,6 +90,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets a value indicating whether this instance is in mixed folder.
/// </summary>
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
+ [IgnoreDataMember]
public bool IsInMixedFolder { get; set; }
[IgnoreDataMember]
@@ -342,6 +345,7 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember]
public DateTime DateModified { get; set; }
+ [IgnoreDataMember]
public DateTime DateLastSaved { get; set; }
[IgnoreDataMember]
@@ -380,6 +384,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the locked fields.
/// </summary>
/// <value>The locked fields.</value>
+ [IgnoreDataMember]
public List<MetadataFields> LockedFields { get; set; }
/// <summary>
@@ -620,6 +625,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the studios.
/// </summary>
/// <value>The studios.</value>
+ [IgnoreDataMember]
public List<string> Studios { get; set; }
/// <summary>
@@ -633,6 +639,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
+ [IgnoreDataMember]
public List<string> Tags { get; set; }
/// <summary>
diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.cs
index f006fedd2..5ef098ff8 100644
--- a/MediaBrowser.Controller/Entities/Book.cs
+++ b/MediaBrowser.Controller/Entities/Book.cs
@@ -2,6 +2,7 @@
using MediaBrowser.Model.Configuration;
using System.Collections.Generic;
using System.Linq;
+using System.Runtime.Serialization;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Users;
@@ -9,6 +10,7 @@ namespace MediaBrowser.Controller.Entities
{
public class Book : BaseItem, IHasTags, IHasLookupInfo<BookInfo>, IHasSeries
{
+ [IgnoreDataMember]
public override string MediaType
{
get
diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs
index 3c7d39e0d..3bff5bc64 100644
--- a/MediaBrowser.Controller/Entities/Trailer.cs
+++ b/MediaBrowser.Controller/Entities/Trailer.cs
@@ -14,7 +14,6 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Trailer
/// </summary>
- [Obsolete]
public class Trailer : Video, IHasCriticRating, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTaglines, IHasMetascore, IHasLookupInfo<TrailerInfo>
{
public List<string> ProductionLocations { get; set; }
diff --git a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
index d1a415f73..937a3f8fd 100644
--- a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
+++ b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
@@ -488,7 +488,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
var itemsResult = _libraryManager.GetItemsResult(new InternalItemsQuery(user)
{
Person = person.Name,
- IncludeItemTypes = new[] { typeof(Movie).Name, typeof(Series).Name, typeof(ChannelVideoItem).Name },
+ IncludeItemTypes = new[] { typeof(Movie).Name, typeof(Series).Name, typeof(Trailer).Name, typeof(ChannelVideoItem).Name },
SortBy = new[] { ItemSortBy.SortName },
Limit = limit,
StartIndex = startIndex
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
index 160397e7c..c6452d8f5 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -350,16 +350,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer
localPath.IndexOf("dashboard/", StringComparison.OrdinalIgnoreCase) != -1)
{
httpRes.StatusCode = 200;
- httpRes.ContentType = "text/plain";
+ httpRes.ContentType = "text/html";
var newUrl = urlString.Replace("mediabrowser", "emby", StringComparison.OrdinalIgnoreCase)
.Replace("/dashboard/", "/web/", StringComparison.OrdinalIgnoreCase);
- httpRes.Write("Please update your Emby bookmark to " + newUrl);
+ httpRes.Write("<!doctype html><html><head><title>Emby</title></head><body>Please update your Emby bookmark to <a href=\"" + newUrl + "\">" + newUrl + "</a></body></html>");
httpRes.Close();
return Task.FromResult(true);
}
-
+
if (string.Equals(localPath, "/emby/", StringComparison.OrdinalIgnoreCase))
{
httpRes.RedirectToUrl(DefaultRedirectPath);
@@ -396,7 +396,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
httpRes.RedirectToUrl("web/pin.html");
return Task.FromResult(true);
}
-
+
if (!string.IsNullOrWhiteSpace(GlobalResponse))
{
httpRes.StatusCode = 503;
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index 18a41d82a..56daff78a 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -348,7 +348,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
"Genres",
"ParentId",
"Audio",
- "ExternalServiceId"
+ "ExternalServiceId",
+ "IsInMixedFolder",
+ "DateLastSaved",
+ "LockedFields",
+ "Studios",
+ "Tags"
};
private readonly string[] _mediaStreamSaveColumns =
@@ -1079,6 +1084,31 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
+ if (!reader.IsDBNull(44))
+ {
+ item.IsInMixedFolder = reader.GetBoolean(44);
+ }
+
+ if (!reader.IsDBNull(45))
+ {
+ item.DateLastSaved = reader.GetDateTime(45).ToUniversalTime();
+ }
+
+ if (!reader.IsDBNull(46))
+ {
+ item.LockedFields = reader.GetString(46).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => (MetadataFields)Enum.Parse(typeof(MetadataFields), i, true)).ToList();
+ }
+
+ if (!reader.IsDBNull(47))
+ {
+ item.Studios = reader.GetString(47).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
+ }
+
+ if (!reader.IsDBNull(48))
+ {
+ item.Tags = reader.GetString(48).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
+ }
+
return item;
}
@@ -2013,6 +2043,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
typeof(MusicGenre),
typeof(MusicVideo),
typeof(Movie),
+ typeof(Trailer),
typeof(BoxSet),
typeof(Episode),
typeof(ChannelVideoItem),
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
index 55f6ca7a4..753946ac4 100644
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
@@ -261,11 +261,21 @@ namespace MediaBrowser.WebDashboard.Api
{
html = ModifyForCordova(html);
}
- else if (!string.IsNullOrWhiteSpace(path) && !string.Equals(path, "index.html", StringComparison.OrdinalIgnoreCase) && html.IndexOf("<html", StringComparison.OrdinalIgnoreCase) == -1)
+ else if (!string.IsNullOrWhiteSpace(path) && !string.Equals(path, "index.html", StringComparison.OrdinalIgnoreCase))
{
- var indexFile = File.ReadAllText(GetDashboardResourcePath("index.html"));
+ var index = html.IndexOf("<body", StringComparison.OrdinalIgnoreCase);
+ if (index != -1)
+ {
+ html = html.Substring(index);
+ index = html.IndexOf("</body>", StringComparison.OrdinalIgnoreCase);
+ if (index != -1)
+ {
+ html = html.Substring(0, index+7);
+ }
+ }
+ var mainFile = File.ReadAllText(GetDashboardResourcePath("index.html"));
- html = ReplaceFirst(indexFile, "<div class=\"mainAnimatedPage hide\"></div>", "<div class=\"mainAnimatedPage hide\">" + html + "</div>");
+ html = ReplaceFirst(mainFile, "<div class=\"mainAnimatedPage hide\"></div>", "<div class=\"mainAnimatedPage hide\">" + html + "</div>");
}
if (!string.IsNullOrWhiteSpace(localizationCulture))
@@ -305,7 +315,15 @@ namespace MediaBrowser.WebDashboard.Api
html = html.Replace("<head>", "<head>" + GetMetaTags(mode) + GetCommonCss(mode, appVersion));
- html = html.Replace("</body>", GetCommonJavascript(mode, appVersion) + "</body>");
+ // Inject sripts before any embedded scripts
+ if (html.IndexOf("<script", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ html = ReplaceFirst(html, "<script", GetCommonJavascript(mode, appVersion, false) + "<script");
+ }
+ else
+ {
+ html = html.Replace("</body>", GetCommonJavascript(mode, appVersion, true) + "</body>");
+ }
var bytes = Encoding.UTF8.GetBytes(html);
@@ -428,8 +446,9 @@ namespace MediaBrowser.WebDashboard.Api
/// </summary>
/// <param name="mode">The mode.</param>
/// <param name="version">The version.</param>
+ /// <param name="async">if set to <c>true</c> [asynchronous].</param>
/// <returns>System.String.</returns>
- private string GetCommonJavascript(string mode, string version)
+ private string GetCommonJavascript(string mode, string version, bool async)
{
var builder = new StringBuilder();
@@ -463,7 +482,11 @@ namespace MediaBrowser.WebDashboard.Api
{
if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1)
{
- return string.Format("<script src=\"{0}\" async></script>", s);
+ if (async)
+ {
+ return string.Format("<script src=\"{0}\" async></script>", s);
+ }
+ return string.Format("<script src=\"{0}\"></script>", s);
}
return string.Format("<script src=\"{0}\"></script>", s);