From 04041105d836cd37dc091e1fbe6adeae32eca0b9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 30 Jun 2015 19:59:45 -0400 Subject: add new sharing function --- .../Localization/JavaScript/javascript.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json') diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 8bc244891..254e3c2f3 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -38,7 +38,7 @@ "HeaderSupportTheTeam": "Support the Emby Team", "TextEnjoyBonusFeatures": "Enjoy Bonus Features", "TitleLiveTV": "Live TV", - "ButtonCancelSyncJob": "Cancel sync job", + "ButtonCancelSyncJob": "Cancel sync job", "TitleSync": "Sync", "HeaderSelectDate": "Select Date", "ButtonDonate": "Donate", @@ -811,5 +811,8 @@ "ErrorMessagePasswordNotMatchConfirm": "The password and password confirmation must match.", "ErrorMessageUsernameInUse": "The username is already in use. Please choose a new name and try again.", "ErrorMessageEmailInUse": "The email address is already in use. Please enter a new email address and try again, or use the forgot password feature.", - "MessageThankYouForConnectSignUp": "Thank you for signing up for Emby Connect. An email will be sent to your address with instructions on how to confirm your new account. Please confirm the account and then return here to sign in." + "MessageThankYouForConnectSignUp": "Thank you for signing up for Emby Connect. An email will be sent to your address with instructions on how to confirm your new account. Please confirm the account and then return here to sign in.", + "HeaderShare": "Share", + "ButtonShareHelp": "Only a web page containing media information will be shared. Media files are never shared publicly." + } -- cgit v1.2.3 From 67ed8070dcb31eb41be47fefa5ee29bd081e6c47 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 2 Jul 2015 01:08:05 -0400 Subject: add sharing function --- .../Dto/DtoService.cs | 1 + .../Localization/JavaScript/javascript.json | 5 +-- .../Persistence/SqliteItemRepository.cs | 22 ++++++++++-- .../Social/SharingManager.cs | 29 +++++++++++---- MediaBrowser.WebDashboard/Api/PackageCreator.cs | 41 +++++++++++++--------- .../MediaBrowser.WebDashboard.csproj | 3 ++ 6 files changed, 74 insertions(+), 27 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json') diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index de63fada0..d147777bd 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -736,6 +736,7 @@ namespace MediaBrowser.Server.Implementations.Dto } }) .Where(i => i != null) + .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase) .ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase); for (var i = 0; i < studios.Count; i++) diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 254e3c2f3..b82bd29a7 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -813,6 +813,7 @@ "ErrorMessageEmailInUse": "The email address is already in use. Please enter a new email address and try again, or use the forgot password feature.", "MessageThankYouForConnectSignUp": "Thank you for signing up for Emby Connect. An email will be sent to your address with instructions on how to confirm your new account. Please confirm the account and then return here to sign in.", "HeaderShare": "Share", - "ButtonShareHelp": "Only a web page containing media information will be shared. Media files are never shared publicly." - + "ButtonShareHelp": "Share a web page containing media information with social media. Media files are never shared publicly.", + "ButtonShare": "Share", + "HeaderConfirm": "Confirm" } diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index ff689ac7f..9778e3c32 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -1,3 +1,4 @@ +using System.Runtime.Serialization; using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.LiveTv; @@ -413,7 +414,15 @@ namespace MediaBrowser.Server.Implementations.Persistence using (var stream = reader.GetMemoryStream(1)) { - return _jsonSerializer.DeserializeFromStream(stream, type) as BaseItem; + try + { + return _jsonSerializer.DeserializeFromStream(stream, type) as BaseItem; + } + catch (SerializationException ex) + { + _logger.ErrorException("Error deserializing item", ex); + return null; + } } } @@ -696,7 +705,11 @@ namespace MediaBrowser.Server.Implementations.Persistence { while (reader.Read()) { - list.Add(GetItem(reader)); + var item = GetItem(reader); + if (item != null) + { + list.Add(item); + } } if (reader.NextResult() && reader.Read()) @@ -986,6 +999,11 @@ namespace MediaBrowser.Server.Implementations.Persistence _deleteChildrenCommand.Transaction = transaction; _deleteChildrenCommand.ExecuteNonQuery(); + // Delete people + _deletePeopleCommand.GetParameter(0).Value = id; + _deletePeopleCommand.Transaction = transaction; + _deletePeopleCommand.ExecuteNonQuery(); + // Delete the item _deleteItemCommand.GetParameter(0).Value = id; _deleteItemCommand.Transaction = transaction; diff --git a/MediaBrowser.Server.Implementations/Social/SharingManager.cs b/MediaBrowser.Server.Implementations/Social/SharingManager.cs index 1c3f35389..326b2893c 100644 --- a/MediaBrowser.Server.Implementations/Social/SharingManager.cs +++ b/MediaBrowser.Server.Implementations/Social/SharingManager.cs @@ -55,17 +55,14 @@ namespace MediaBrowser.Server.Implementations.Social Id = Guid.NewGuid().ToString("N"), ExpirationDate = DateTime.UtcNow.AddDays(_config.Configuration.SharingExpirationDays), ItemId = itemId, - UserId = userId, - Overview = item.Overview, - Name = GetTitle(item) + UserId = userId }; - info.ImageUrl = externalUrl + "/Social/Shares/Public/" + info.Id + "/Image"; - info.ImageUrl = externalUrl + "/web/shared.html?id=" + info.Id; - + AddShareInfo(info); + await _repository.CreateShare(info).ConfigureAwait(false); - return GetShareInfo(info.Id); + return info; } private string GetTitle(BaseItem item) @@ -77,9 +74,27 @@ namespace MediaBrowser.Server.Implementations.Social { var info = _repository.GetShareInfo(id); + AddShareInfo(info); + return info; } + private void AddShareInfo(SocialShareInfo info) + { + var externalUrl = _appHost.GetSystemInfo().WanAddress; + + info.ImageUrl = externalUrl + "/Social/Shares/Public/" + info.Id + "/Image"; + info.Url = externalUrl + "/web/shared.html?id=" + info.Id; + + var item = _libraryManager.GetItemById(info.ItemId); + + if (item != null) + { + info.Overview = item.Overview; + info.Name = GetTitle(item); + } + } + public Task DeleteShare(string id) { return _repository.DeleteShare(id); diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 1b03790bd..4d2bc0215 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -375,6 +375,14 @@ namespace MediaBrowser.WebDashboard.Api sb.Append(""); + // Open graph tags + sb.Append(""); + sb.Append(""); + sb.Append(""); + sb.Append(""); + sb.Append(""); + //sb.Append(""); + // http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html sb.Append(""); sb.Append(""); @@ -649,28 +657,29 @@ namespace MediaBrowser.WebDashboard.Api var files = new[] { - "site.css", - "chromecast.css", - "nowplayingbar.css", - "mediaplayer.css", - "mediaplayer-video.css", - "librarymenu.css", - "librarybrowser.css", - "card.css", - "notifications.css", - "search.css", - "pluginupdates.css", - "remotecontrol.css", - "userimage.css", - "nowplaying.css", - "materialize.css" + "css/site.css", + "css/chromecast.css", + "css/nowplayingbar.css", + "css/mediaplayer.css", + "css/mediaplayer-video.css", + "css/librarymenu.css", + "css/librarybrowser.css", + "css/card.css", + "css/notifications.css", + "css/search.css", + "css/pluginupdates.css", + "css/remotecontrol.css", + "css/userimage.css", + "css/nowplaying.css", + "css/materialize.css", + "thirdparty/paper-button-style.css" }; var builder = new StringBuilder(); foreach (var file in files) { - var path = GetDashboardResourcePath("css/" + file); + var path = GetDashboardResourcePath(file); using (var fs = _fileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true)) { diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index bd5981363..a9a4c0647 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -127,6 +127,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From 6b8bcf4c1198569d037c2cef4457c271d5fd5213 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 15 Jul 2015 07:26:47 -0400 Subject: update metadata manager --- .../Localization/JavaScript/javascript.json | 3 ++- MediaBrowser.WebDashboard/Api/DashboardService.cs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json') diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index b82bd29a7..2d56e9656 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -815,5 +815,6 @@ "HeaderShare": "Share", "ButtonShareHelp": "Share a web page containing media information with social media. Media files are never shared publicly.", "ButtonShare": "Share", - "HeaderConfirm": "Confirm" + "HeaderConfirm": "Confirm", + "ButtonAdvancedRefresh": "Advanced Refresh" } diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 2346e15d3..7747a1569 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -317,7 +317,6 @@ namespace MediaBrowser.WebDashboard.Api File.Delete(Path.Combine(path, "thirdparty", "jquerymobile-1.4.5", "jquery.mobile-1.4.5.min.map")); - Directory.Delete(Path.Combine(path, "bower_components"), true); Directory.Delete(Path.Combine(path, "thirdparty", "viblast"), true); // But we do need this @@ -332,7 +331,7 @@ namespace MediaBrowser.WebDashboard.Api CopyDirectory(Path.Combine(creator.DashboardUIPath, "bower_components", "swipebox", "src", "js"), Path.Combine(path, "bower_components", "swipebox", "src", "js")); CopyDirectory(Path.Combine(creator.DashboardUIPath, "bower_components", "swipebox", "src", "img"), Path.Combine(path, "bower_components", "swipebox", "src", "img")); } - + MinifyCssDirectory(Path.Combine(path, "css")); MinifyJsDirectory(Path.Combine(path, "scripts")); MinifyJsDirectory(Path.Combine(path, "apiclient")); -- cgit v1.2.3