浏览代码

add organize now/sync prepare buttons

Luke Pulverenti 10 年之前
父节点
当前提交
449485d3d2

+ 0 - 1
MediaBrowser.Providers/TV/DummySeasonProvider.cs

@@ -112,7 +112,6 @@ namespace MediaBrowser.Providers.TV
                 Name = seasonName,
                 IndexNumber = seasonNumber,
                 Parent = series,
-                DisplayMediaType = typeof(Season).Name,
                 Id = (series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName).GetMBId(typeof(Season))
             };
 

+ 0 - 1
MediaBrowser.Providers/TV/MissingEpisodeProvider.cs

@@ -406,7 +406,6 @@ namespace MediaBrowser.Providers.TV
                 IndexNumber = episodeNumber,
                 ParentIndexNumber = seasonNumber,
                 Parent = season,
-                DisplayMediaType = typeof(Episode).Name,
                 Id = (series.Id + seasonNumber.ToString(_usCulture) + name).GetMBId(typeof(Episode))
             };
 

+ 0 - 2
MediaBrowser.Server.Implementations/Channels/ChannelManager.cs

@@ -1263,8 +1263,6 @@ namespace MediaBrowser.Server.Implementations.Channels
                 var mediaSource = info.MediaSources.FirstOrDefault();
 
                 item.Path = mediaSource == null ? null : mediaSource.Path;
-
-                item.DisplayMediaType = channelMediaItem.ContentType.ToString();
             }
 
             if (isNew)

+ 0 - 1
MediaBrowser.Server.Implementations/Collections/CollectionManager.cs

@@ -69,7 +69,6 @@ namespace MediaBrowser.Server.Implementations.Collections
                 {
                     Name = name,
                     Parent = parentFolder,
-                    DisplayMediaType = "Collection",
                     Path = path,
                     IsLocked = options.IsLocked,
                     ProviderIds = options.ProviderIds,

+ 0 - 1
MediaBrowser.Server.Implementations/Devices/CameraUploadsFolder.cs

@@ -10,7 +10,6 @@ namespace MediaBrowser.Server.Implementations.Devices
         public CameraUploadsFolder()
         {
             Name = "Camera Uploads";
-            DisplayMediaType = "CollectionFolder";
         }
 
         public override bool IsVisible(User user)

+ 6 - 1
MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs

@@ -13,7 +13,7 @@ using System.Threading.Tasks;
 
 namespace MediaBrowser.Server.Implementations.FileOrganization
 {
-    public class OrganizerScheduledTask : IScheduledTask, IConfigurableScheduledTask, IScheduledTaskActivityLog
+    public class OrganizerScheduledTask : IScheduledTask, IConfigurableScheduledTask, IScheduledTaskActivityLog, IHasKey
     {
         private readonly ILibraryMonitor _libraryMonitor;
         private readonly ILibraryManager _libraryManager;
@@ -82,5 +82,10 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
         {
             get { return false; }
         }
+
+        public string Key
+        {
+            get { return "AutoOrganize"; }
+        }
     }
 }

+ 0 - 12
MediaBrowser.Server.Implementations/Library/ResolverHelper.cs

@@ -39,12 +39,6 @@ namespace MediaBrowser.Server.Implementations.Library
 
             item.Id = libraryManager.GetNewItemId(item.Path, item.GetType());
 
-            // If the resolver didn't specify this
-            if (string.IsNullOrEmpty(item.DisplayMediaType))
-            {
-                item.DisplayMediaType = item.GetType().Name;
-            }
-
             item.IsLocked = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 ||
                 item.Parents.Any(i => i.IsLocked);
 
@@ -79,12 +73,6 @@ namespace MediaBrowser.Server.Implementations.Library
 
             item.Id = libraryManager.GetNewItemId(item.Path, item.GetType());
 
-            // If the resolver didn't specify this
-            if (string.IsNullOrEmpty(item.DisplayMediaType))
-            {
-                item.DisplayMediaType = item.GetType().Name;
-            }
-
             // Make sure the item has a name
             EnsureName(item, args.FileInfo);
 

+ 7 - 0
MediaBrowser.Server.Implementations/Library/UserManager.cs

@@ -411,6 +411,7 @@ namespace MediaBrowser.Server.Implementations.Library
                     catch
                     {
                         user.Policy.EnabledFolders = new string[] { };
+                        user.Policy.EnableAllFolders = true;
                     }
                 }
                 else
@@ -419,6 +420,12 @@ namespace MediaBrowser.Server.Implementations.Library
                     user.Policy.EnabledFolders = new string[] { };
                 }
 
+                // Just to be safe
+                if (user.Policy.EnabledFolders.Length == 0)
+                {
+                    user.Policy.EnableAllFolders = true;
+                }
+
                 user.Policy.BlockedMediaFolders = null;
 
                 await UpdateUserPolicy(user, user.Policy, false);

+ 2 - 0
MediaBrowser.Server.Implementations/Localization/Server/server.json

@@ -46,6 +46,8 @@
     "OptionEnableWebClientResourceMinification": "Enable web client resource minification",
     "LabelDashboardSourcePath": "Web client source path:",
     "LabelDashboardSourcePathHelp": "If running the server from source, specify the path to the dashboard-ui folder. All web client files will be served from this location.",
+    "ButtonConvertMedia": "Convert media",
+    "ButtonOrganizeNow":  "Organize now",
     "ButtonOk": "Ok",
     "ButtonCancel": "Cancel",
     "ButtonNew": "New",

+ 8 - 3
MediaBrowser.Server.Implementations/Sync/SyncScheduledTask.cs

@@ -13,7 +13,7 @@ using System.Threading.Tasks;
 
 namespace MediaBrowser.Server.Implementations.Sync
 {
-    public class SyncScheduledTask : IScheduledTask, IConfigurableScheduledTask
+    public class SyncScheduledTask : IScheduledTask, IConfigurableScheduledTask, IHasKey
     {
         private readonly ILibraryManager _libraryManager;
         private readonly ISyncRepository _syncRepo;
@@ -42,7 +42,7 @@ namespace MediaBrowser.Server.Implementations.Sync
 
         public string Name
         {
-            get { return "Sync preparation"; }
+            get { return "Convert media"; }
         }
 
         public string Description
@@ -54,7 +54,7 @@ namespace MediaBrowser.Server.Implementations.Sync
         {
             get
             {
-                return "Library";
+                return "Sync";
             }
         }
 
@@ -82,5 +82,10 @@ namespace MediaBrowser.Server.Implementations.Sync
         {
             get { return true; }
         }
+
+        public string Key
+        {
+            get { return "SyncPrepare"; }
+        }
     }
 }