@@ -2420,6 +2420,7 @@ data QuickFoFTask
2420
2420
= QFoFInPlace
2421
2421
| QFoFKeepOriginal
2422
2422
| QFoFDeleteOriginal
2423
+ deriving (Eq )
2423
2424
2424
2425
pageQuickConvertCH
2425
2426
:: (? preferences :: Preferences )
@@ -2536,7 +2537,15 @@ pageQuickConvertCH sink rect tab startTasks = mdo
2536
2537
FL. setCallback btnGo $ \ _ -> do
2537
2538
qfofs <- readMVar loadedFiles
2538
2539
transform <- getTransform
2539
- let warningText = " This will modify the selected songs, and the old versions will be deleted."
2540
+ let warningText = T. unlines $ concat
2541
+ [ [" This will modify the selected songs, and the old versions will be deleted." ]
2542
+ , do
2543
+ guard $ any (\ qfof -> qfof. format == FoFEncore ) qfofs
2544
+ [ " "
2545
+ , " WARNING: This will convert Encore-format songs into CH-compatible ones, removing the original files."
2546
+ , " Select a different mode if you want to keep them."
2547
+ ]
2548
+ ]
2540
2549
FL. flChoice warningText " Cancel" (Just " Start" ) Nothing >>= \ case
2541
2550
1 -> sink $ EventOnyx $ do
2542
2551
-- TODO this is a hack to avoid stale .sng references after editing them.
@@ -2549,7 +2558,7 @@ pageQuickConvertCH sink rect tab startTasks = mdo
2549
2558
stackIO $ case qfof. format of
2550
2559
FoFFormat FoFFolder -> saveQuickFoFFolder loc qfof
2551
2560
FoFFormat FoFSNG -> fillRequiredMetadata qfof >>= saveQuickFoFSNG loc
2552
- FoFEncore -> saveQuickFoFFolder loc qfof -- TODO forbid this!
2561
+ FoFEncore -> saveQuickFoFFolder loc qfof
2553
2562
return [loc]
2554
2563
in (loc, task)
2555
2564
_ -> return ()
@@ -2561,17 +2570,26 @@ pageQuickConvertCH sink rect tab startTasks = mdo
2561
2570
then QFoFInPlace
2562
2571
else if deleteOriginals then QFoFDeleteOriginal else QFoFKeepOriginal
2563
2572
return (qfof, fin, task, fout)
2573
+ promptTasks :: [(QuickFoF , FilePath , QuickFoFTask , FilePath )] -> IO () -> IO ()
2564
2574
promptTasks tasks f = let
2565
2575
numInPlace = length [ () | (_, _, QFoFInPlace , _) <- tasks ]
2566
2576
numKeepOriginal = length [ () | (_, _, QFoFKeepOriginal , _) <- tasks ]
2567
2577
numDeleteOriginal = length [ () | (_, _, QFoFDeleteOriginal , _) <- tasks ]
2578
+ numDeleteEncore = length $ do
2579
+ (qfof, _, task, _) <- tasks
2580
+ guard $ qfof. format == FoFEncore
2581
+ guard $ elem task [QFoFInPlace , QFoFDeleteOriginal ]
2582
+ return ()
2568
2583
numSongs 1 = " 1 song"
2569
2584
numSongs n = T. pack (show n) <> " songs"
2570
2585
warningText = T. unlines $ concat
2571
2586
[ [" Based on the filename template, these operations will be performed:" ]
2572
2587
, guard (numInPlace /= 0 ) >> [" - " <> numSongs numInPlace <> " will be overwritten with new versions" ]
2573
2588
, guard (numKeepOriginal /= 0 ) >> [" - " <> numSongs numKeepOriginal <> " will be converted to new versions" ]
2574
2589
, guard (numDeleteOriginal /= 0 ) >> [" - " <> numSongs numDeleteOriginal <> " will be converted to new versions, and the old versions will be deleted" ]
2590
+ , do
2591
+ guard $ numDeleteEncore /= 0
2592
+ [" " , " WARNING: Some Encore-format songs will be removed/replaced by CH-compatible ones" ]
2575
2593
]
2576
2594
in FL. flChoice warningText " Cancel" (Just " Start" ) Nothing >>= \ case
2577
2595
1 -> f
0 commit comments