aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs1
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json5
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs22
-rw-r--r--MediaBrowser.Server.Implementations/Social/SharingManager.cs29
-rw-r--r--MediaBrowser.WebDashboard/Api/PackageCreator.cs41
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj3
6 files changed, 74 insertions, 27 deletions
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("<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />");
+ // Open graph tags
+ sb.Append("<meta property=\"og:title\" content=\"Emby\" />");
+ sb.Append("<meta property=\"og:site_name\" content=\"Emby\"/>");
+ sb.Append("<meta property=\"og:url\" content=\"http://emby.media\" />");
+ sb.Append("<meta property=\"og:description\" content=\"Energize your media.\" />");
+ sb.Append("<meta property=\"og:type\" content=\"article\" />");
+ //sb.Append("<meta property=\"fb:app_id\" content=\"[FB_APP_ID]\" />");
+
// http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
sb.Append("<link rel=\"apple-touch-icon\" href=\"css/images/touchicon.png\" />");
sb.Append("<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"css/images/touchicon72.png\" />");
@@ -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 @@
<Content Include="dashboard-ui\cordova\android\logging.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\cordova\sharingwidget.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\css\images\clients\androidtv-tile.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>