mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Remove image move code
This commit is contained in:
parent
d872e66f7d
commit
b904f25d33
@ -17,7 +17,6 @@
|
|||||||
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
|
||||||
using Kyoo.Authentication;
|
using Kyoo.Authentication;
|
||||||
using Kyoo.Core;
|
using Kyoo.Core;
|
||||||
using Kyoo.Core.Extensions;
|
using Kyoo.Core.Extensions;
|
||||||
@ -93,42 +92,6 @@ app.UseRouting();
|
|||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
// TODO: wait 4.5.0 and delete this
|
|
||||||
static void MoveAll(DirectoryInfo source, DirectoryInfo target)
|
|
||||||
{
|
|
||||||
if (source.FullName == target.FullName)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Directory.CreateDirectory(target.FullName);
|
|
||||||
|
|
||||||
foreach (FileInfo fi in source.GetFiles())
|
|
||||||
fi.MoveTo(Path.Combine(target.ToString(), fi.Name), true);
|
|
||||||
|
|
||||||
foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
|
|
||||||
{
|
|
||||||
DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(diSourceSubDir.Name);
|
|
||||||
MoveAll(diSourceSubDir, nextTargetSubDir);
|
|
||||||
}
|
|
||||||
Directory.Delete(source.FullName);
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string oldDir = "/kyoo/kyoo_datadir/metadata";
|
|
||||||
if (Path.Exists(oldDir))
|
|
||||||
{
|
|
||||||
MoveAll(new DirectoryInfo(oldDir), new DirectoryInfo("/metadata"));
|
|
||||||
Log.Warning("Old metadata directory migrated.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.Fatal(
|
|
||||||
ex,
|
|
||||||
"Unhandled error while trying to migrate old metadata images to new directory. Giving up and continuing normal startup."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Activate services that always run in the background
|
// Activate services that always run in the background
|
||||||
app.Services.GetRequiredService<MeiliSync>();
|
app.Services.GetRequiredService<MeiliSync>();
|
||||||
app.Services.GetRequiredService<RabbitProducer>();
|
app.Services.GetRequiredService<RabbitProducer>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user