mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
removed shortcut migration
This commit is contained in:
parent
0b01f9d282
commit
b8f642a2d4
@ -214,8 +214,6 @@ namespace MediaBrowser.ServerApplication
|
|||||||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||||
|
|
||||||
MigrateShortcuts(appPaths.RootFolderPath);
|
|
||||||
|
|
||||||
_appHost = new ApplicationHost(appPaths, logManager);
|
_appHost = new ApplicationHost(appPaths, logManager);
|
||||||
|
|
||||||
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
||||||
@ -537,34 +535,5 @@ namespace MediaBrowser.ServerApplication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
SEM_NOOPENFILEERRORBOX = 0x8000
|
SEM_NOOPENFILEERRORBOX = 0x8000
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void MigrateShortcuts(string directory)
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(directory);
|
|
||||||
|
|
||||||
foreach (var file in Directory.EnumerateFiles(directory, "*.lnk", SearchOption.AllDirectories).ToList())
|
|
||||||
{
|
|
||||||
MigrateShortcut(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void MigrateShortcut(string file)
|
|
||||||
{
|
|
||||||
var newFile = Path.ChangeExtension(file, ".mblink");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var resolvedPath = FileSystem.ResolveShortcut(file);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(resolvedPath))
|
|
||||||
{
|
|
||||||
FileSystem.CreateShortcut(newFile, resolvedPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
File.Delete(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user