|
@@ -113,6 +113,7 @@ protocol MediaLibraryMigrationDelegate: class {
|
|
|
class MediaLibraryService: NSObject {
|
|
|
private static let databaseName: String = "medialibrary.db"
|
|
|
private static let migrationKey: String = "MigratedToVLCMediaLibraryKit"
|
|
|
+ private static let didForceRescan: String = "MediaLibraryDidForceRescan"
|
|
|
|
|
|
private var didMigrate = UserDefaults.standard.bool(forKey: MediaLibraryService.migrationKey)
|
|
|
private var didFinishDiscovery = false
|
|
@@ -152,6 +153,11 @@ private extension MediaLibraryService {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ if UserDefaults.standard.bool(forKey: MediaLibraryService.didForceRescan) == false {
|
|
|
+ medialib.forceRescan()
|
|
|
+ UserDefaults.standard.set(true, forKey: MediaLibraryService.didForceRescan)
|
|
|
+ }
|
|
|
+
|
|
|
/* exclude Document directory from backup (QA1719) */
|
|
|
if let documentPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first {
|
|
|
var excludeURL = URL(fileURLWithPath: documentPath)
|