diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-04 14:05:24 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-04 14:05:24 -0400 |
| commit | 7a084a589ed1b43cb59dc323388b31b28b0d3d91 (patch) | |
| tree | 9cfeddac88af1fae8b2b9f9777d7e513d52fdfb8 /MediaBrowser.Server.Implementations | |
| parent | e83a3e710be75da138ef7b79d7351a4075151efc (diff) | |
added dashboard tour
Diffstat (limited to 'MediaBrowser.Server.Implementations')
3 files changed, 85 insertions, 17 deletions
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 995bfe6f6..b31c84128 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -579,18 +579,26 @@ "LabelFullReview": "Full review:", "LabelShortRatingDescription": "Short rating summary:", "OptionIRecommendThisItem": "I recommend this item", - "WebClientTourContent": "View your recently added media, next episodes, and more. The green circles indicate how many unplayed items you have.", - "WebClientTourMovies": "Play movies, trailers and more from any device with a web browser", - "WebClientTourMouseOver": "Hold the mouse over any poster for quick access to important information", - "WebClientTourTapHold": "Tap and hold or right click any poster for a context menu", - "WebClientTourMetadataManager": "Click edit to open the metadata manager", - "WebClientTourPlaylists": "Easily create playlists and instant mixes, and play them on any device", - "WebClientTourCollections": "Create movie collections to group box sets together", - "WebClientTourUserPreferences1": "User preferences allow you to customize the way your library is presented in all of your Media Browser apps", - "WebClientTourUserPreferences2": "Configure your audio and subtitle language settings once, for every Media Browser app", - "WebClientTourUserPreferences3": "Design the web client home page to your liking", - "WebClientTourUserPreferences4": "Configure backdrops, theme songs and external players", - "WebClientTourMobile1": "The web client works great on smartphones and tablets...", - "WebClientTourMobile2": "and easily controls other devices and Media Browser apps", - "MessageEnjoyYourStay": "Enjoy your stay" + "WebClientTourContent": "View your recently added media, next episodes, and more. The green circles indicate how many unplayed items you have.", + "WebClientTourMovies": "Play movies, trailers and more from any device with a web browser", + "WebClientTourMouseOver": "Hold the mouse over any poster for quick access to important information", + "WebClientTourTapHold": "Tap and hold or right click any poster for a context menu", + "WebClientTourMetadataManager": "Click edit to open the metadata manager", + "WebClientTourPlaylists": "Easily create playlists and instant mixes, and play them on any device", + "WebClientTourCollections": "Create movie collections to group box sets together", + "WebClientTourUserPreferences1": "User preferences allow you to customize the way your library is presented in all of your Media Browser apps", + "WebClientTourUserPreferences2": "Configure your audio and subtitle language settings once, for every Media Browser app", + "WebClientTourUserPreferences3": "Design the web client home page to your liking", + "WebClientTourUserPreferences4": "Configure backdrops, theme songs and external players", + "WebClientTourMobile1": "The web client works great on smartphones and tablets...", + "WebClientTourMobile2": "and easily controls other devices and Media Browser apps", + "MessageEnjoyYourStay": "Enjoy your stay", + "DashboardTourDashboard": "The server dashboard allows you to monitor your server and your users. You'll always know who is doing what and where they are.", + "DashboardTourUsers": "Easily create user accounts for your friends and family, each with their own permissions, library access, parental controls and more.", + "DashboardTourCinemaMode": "Cinema mode brings the theater experience straight to your living room with the ability to play trailers and custom intros before the main feature.", + "DashboardTourChapters": "Enable chapter image generation for your videos for a more pleasing presentation while viewing.", + "DashboardTourSubtitles": "Automatically download subtitles for your videos in any language.", + "DashboardTourPlugins": "Install plugins such as internet video channels, live tv, metadata scanners, and more.", + "DashboardTourNotifications": "Automatically send notifications of server events to your mobile device, email and more.", + "DashboardTourScheduledTasks": "Easily manage long running operations with scheduled tasks. Decide when they run, and how often." } diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 416281874..af2228ad5 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1206,5 +1206,6 @@ "LabelDisplayTrailersWithinMovieSuggestionsHelp": "Requires installation of the Trailer channel.", "CinemaModeConfigurationHelp2": "Individual users will have the ability to disable cinema mode within their own preferences.", "LabelEnableCinemaMode": "Enable cinema mode", - "HeaderCinemaMode": "Cinema Mode" + "HeaderCinemaMode": "Cinema Mode", + "HeaderWelcomeToMediaBrowserServerDashboard": "Welcome to the Media Browser Server Dashboard" } diff --git a/MediaBrowser.Server.Implementations/Notifications/SqliteNotificationsRepository.cs b/MediaBrowser.Server.Implementations/Notifications/SqliteNotificationsRepository.cs index d34d5a293..f883e6dbc 100644 --- a/MediaBrowser.Server.Implementations/Notifications/SqliteNotificationsRepository.cs +++ b/MediaBrowser.Server.Implementations/Notifications/SqliteNotificationsRepository.cs @@ -15,7 +15,7 @@ namespace MediaBrowser.Server.Implementations.Notifications { public class SqliteNotificationsRepository : INotificationsRepository { - private IDbConnection _connection; + private IDbConnection _connection; private readonly ILogger _logger; private readonly IServerApplicationPaths _appPaths; @@ -33,13 +33,14 @@ namespace MediaBrowser.Server.Implementations.Notifications private IDbCommand _replaceNotificationCommand; private IDbCommand _markReadCommand; + private IDbCommand _markAllReadCommand; public async Task Initialize() { var dbFile = Path.Combine(_appPaths.DataPath, "notifications.db"); _connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false); - + string[] queries = { "create table if not exists Notifications (Id GUID NOT NULL, UserId GUID NOT NULL, Date DATETIME NOT NULL, Name TEXT NOT NULL, Description TEXT, Url TEXT, Level TEXT NOT NULL, IsRead BOOLEAN NOT NULL, Category TEXT NOT NULL, RelatedId TEXT, PRIMARY KEY (Id, UserId))", @@ -78,6 +79,12 @@ namespace MediaBrowser.Server.Implementations.Notifications _markReadCommand.Parameters.Add(_replaceNotificationCommand, "@UserId"); _markReadCommand.Parameters.Add(_replaceNotificationCommand, "@IsRead"); _markReadCommand.Parameters.Add(_replaceNotificationCommand, "@Id"); + + _markAllReadCommand = _connection.CreateCommand(); + _markAllReadCommand.CommandText = "update Notifications set IsRead=@IsRead where UserId=@UserId"; + + _markAllReadCommand.Parameters.Add(_replaceNotificationCommand, "@UserId"); + _markAllReadCommand.Parameters.Add(_replaceNotificationCommand, "@IsRead"); } /// <summary> @@ -357,6 +364,58 @@ namespace MediaBrowser.Server.Implementations.Notifications } } + public async Task MarkAllRead(string userId, bool isRead, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + + await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false); + + IDbTransaction transaction = null; + + try + { + cancellationToken.ThrowIfCancellationRequested(); + + transaction = _connection.BeginTransaction(); + + _markAllReadCommand.GetParameter(0).Value = new Guid(userId); + _markAllReadCommand.GetParameter(1).Value = isRead; + + _markAllReadCommand.ExecuteNonQuery(); + + transaction.Commit(); + } + catch (OperationCanceledException) + { + if (transaction != null) + { + transaction.Rollback(); + } + + throw; + } + catch (Exception e) + { + _logger.ErrorException("Failed to save notification:", e); + + if (transaction != null) + { + transaction.Rollback(); + } + + throw; + } + finally + { + if (transaction != null) + { + transaction.Dispose(); + } + + _writeLock.Release(); + } + } + private async Task MarkReadInternal(IEnumerable<Guid> notificationIdList, string userId, bool isRead, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); |
