aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-02-11 15:23:07 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-02-11 15:23:07 -0500
commit21933002f3c1ad32e02747a9af472b414fa36a46 (patch)
tree52c6e3bcd54fabfdcf7263cb34e5df45de8a0bf6
parentcfb7e50720e037048b24aeacb65371356524216b (diff)
added sync to the tour
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs18
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json2
-rw-r--r--MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloader.cs17
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj6
4 files changed, 28 insertions, 15 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index 9e75591fb..c49a24110 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -104,7 +104,7 @@ namespace MediaBrowser.Server.Implementations.Dto
SetItemByNameInfo(item, dto, libraryItems.ToList(), user);
}
- FillSyncInfo(dto, item, itemIdsWithSyncJobs, options);
+ FillSyncInfo(dto, item, itemIdsWithSyncJobs, options, user);
list.Add(dto);
}
@@ -128,11 +128,11 @@ namespace MediaBrowser.Server.Implementations.Dto
SetItemByNameInfo(item, dto, libraryItems.ToList(), user);
- FillSyncInfo(dto, item, options);
+ FillSyncInfo(dto, item, options, user);
return dto;
}
- FillSyncInfo(dto, item, options);
+ FillSyncInfo(dto, item, options, user);
return dto;
}
@@ -171,11 +171,12 @@ namespace MediaBrowser.Server.Implementations.Dto
return result.Items;
}
- private void FillSyncInfo(BaseItemDto dto, BaseItem item, DtoOptions options)
+ private void FillSyncInfo(BaseItemDto dto, BaseItem item, DtoOptions options, User user)
{
if (options.Fields.Contains(ItemFields.SyncInfo))
{
- dto.SupportsSync = _syncManager.SupportsSync(item);
+ var userCanSync = user != null && user.Policy.EnableSync;
+ dto.SupportsSync = userCanSync && _syncManager.SupportsSync(item);
}
if (dto.SupportsSync ?? false)
@@ -184,11 +185,12 @@ namespace MediaBrowser.Server.Implementations.Dto
}
}
- private void FillSyncInfo(BaseItemDto dto, BaseItem item, IEnumerable<string> itemIdsWithSyncJobs, DtoOptions options)
+ private void FillSyncInfo(BaseItemDto dto, BaseItem item, IEnumerable<string> itemIdsWithSyncJobs, DtoOptions options, User user)
{
if (options.Fields.Contains(ItemFields.SyncInfo))
{
- dto.SupportsSync = _syncManager.SupportsSync(item);
+ var userCanSync = user != null && user.Policy.EnableSync;
+ dto.SupportsSync = userCanSync && _syncManager.SupportsSync(item);
}
if (dto.SupportsSync ?? false)
@@ -308,7 +310,7 @@ namespace MediaBrowser.Server.Implementations.Dto
var dto = GetBaseItemDtoInternal(item, options, user);
SetItemByNameInfo(item, dto, taggedItems, user);
- FillSyncInfo(dto, item, options);
+ FillSyncInfo(dto, item, options, user);
return dto;
}
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
index 31b45cb90..09045be9b 100644
--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
@@ -656,6 +656,7 @@
"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",
+ "WebClientTourMySync": "Sync your personal media to your devices for offline viewing.",
"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.",
"DashboardTourHelp": "In-app help provides easy buttons to open wiki pages relating to the on-screen content.",
@@ -667,6 +668,7 @@
"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.",
"DashboardTourMobile": "The Media Browser dashboard works great on smartphones and tablets. Manage your server from the palm of your hand anytime, anywhere.",
+ "DashboardTourSync": "Sync your personal media to your devices for offline viewing.",
"MessageRefreshQueued": "Refresh queued",
"TabDevices": "Devices",
"TabExtras": "Extras",
diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloader.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloader.cs
index 406863b84..d4cefdb10 100644
--- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloader.cs
+++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloader.cs
@@ -113,7 +113,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
return info;
}
- private void DeleteOlderFolders(string path, IEnumerable<string> excludeFolders )
+ private void DeleteOlderFolders(string path, IEnumerable<string> excludeFolders)
{
var folders = Directory.GetDirectories(path)
.Where(i => !excludeFolders.Contains(i, StringComparer.OrdinalIgnoreCase))
@@ -155,9 +155,9 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
{
return new FFMpegInfo
{
- EncoderPath = encoder,
- ProbePath = probe,
- Version = Path.GetFileName(Path.GetDirectoryName(probe))
+ EncoderPath = encoder,
+ ProbePath = probe,
+ Version = Path.GetFileName(Path.GetDirectoryName(probe))
};
}
}
@@ -217,7 +217,8 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
{
ExtractArchive(downloadinfo, tempFile, tempFolder);
- var files = Directory.EnumerateFiles(tempFolder, "*", SearchOption.AllDirectories).ToList();
+ var files = Directory.EnumerateFiles(tempFolder, "*", SearchOption.AllDirectories)
+ .ToList();
foreach (var file in files.Where(i =>
{
@@ -244,6 +245,8 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
// Linux: File permission to 666, and user's execute bit
if (_environment.OperatingSystem == OperatingSystem.Bsd || _environment.OperatingSystem == OperatingSystem.Linux || _environment.OperatingSystem == OperatingSystem.Osx)
{
+ _logger.Info("Syscall.chmod {0} FilePermissions.DEFFILEMODE | FilePermissions.S_IRWXU | FilePermissions.S_IXGRP | FilePermissions.S_IXOTH", path);
+
Syscall.chmod(path, FilePermissions.DEFFILEMODE | FilePermissions.S_IRWXU | FilePermissions.S_IXGRP | FilePermissions.S_IXOTH);
}
}
@@ -307,7 +310,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
Task.Run(async () =>
{
await DownloadFontFile(fontsDirectory, fontFilename, new Progress<double>()).ConfigureAwait(false);
-
+
await WriteFontConfigFile(fontsDirectory).ConfigureAwait(false);
});
}
@@ -380,7 +383,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
}
Extract7zArchive(tempFile, fontsDirectory);
-
+
try
{
_fileSystem.DeleteFile(tempFile);
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 19098a3ee..b3ee9b881 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -96,6 +96,12 @@
<Content Include="dashboard-ui\css\images\tour\dashboard\help.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\css\images\tour\dashboard\sync.png">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\css\images\tour\web\tourmysync.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\css\materialize.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>