@@ -46,6 +46,8 @@ enum PhotoBackupFolderStructure: String, Codable {
4646 case byYear = " byYear "
4747 case byYearAndType = " byYearAndType "
4848 case byYearMonth = " byYearMonth "
49+ case byYearDashMonth = " byYearDashMonth "
50+ case byYearDashMonthAndType = " byYearDashMonthAndType "
4951 case byYearMonthAndType = " byYearMonthAndType "
5052 case singleFolder = " singleFolder "
5153 case singleFolderDatePrefixed = " singleFolderDatePrefixed "
@@ -60,6 +62,8 @@ enum PhotoBackupFolderStructure: String, Codable {
6062 case . byYearAndType: return String ( localized: " 2024/Video/IMG_2020.MOV " )
6163 case . byYearMonth: return String ( localized: " 2024/08/IMG_2020.HEIC " )
6264 case . byYearMonthAndType: return String ( localized: " 2024/08/Video/IMG_2020.MOV " )
65+ case . byYearDashMonth: return String ( localized: " 2024-08/IMG_2020.HEIC " )
66+ case . byYearDashMonthAndType: return String ( localized: " 2024-08/Video/IMG_2020.MOV " )
6367 case . byType: return String ( localized: " Video/IMG_2020.MOV " )
6468 case . singleFolder: return String ( localized: " IMG_2020.MOV " )
6569 case . singleFolderDatePrefixed: return String ( localized: " 2024-08-11_IMG_2020.MOV " )
@@ -69,7 +73,7 @@ enum PhotoBackupFolderStructure: String, Codable {
6973 var usesTimeZone : Bool {
7074 switch self {
7175 case . byDate, . byDateAndType, . byDateComponent, . byDateComponentAndType, . singleFolderDatePrefixed,
72- . byYear, . byYearMonth, . byYearAndType, . byYearMonthAndType:
76+ . byYear, . byYearMonth, . byYearAndType, . byYearMonthAndType, . byYearDashMonth , . byYearDashMonthAndType :
7377 return true
7478 case . byType, . singleFolder: return false
7579 }
@@ -86,6 +90,9 @@ enum PhotoBackupFolderStructure: String, Codable {
8690 case . byYearMonth, . byYearMonthAndType:
8791 return [ " yyyy " , " MM " ]
8892
93+ case . byYearDashMonth, . byYearDashMonthAndType:
94+ return [ " yyyy-MM " ]
95+
8996 case . byType, . singleFolder, . byDate, . byDateAndType, . singleFolderDatePrefixed:
9097 return [ ]
9198 }
@@ -835,7 +842,8 @@ extension PHAsset {
835842 components. append ( dateString)
836843 }
837844
838- case . byDateComponent, . byDateComponentAndType, . byYear, . byYearMonth, . byYearAndType, . byYearMonthAndType:
845+ case . byDateComponent, . byDateComponentAndType, . byYear, . byYearMonth, . byYearAndType, . byYearMonthAndType,
846+ . byYearDashMonth, . byYearDashMonthAndType:
839847 if let creationDate = self . creationDate {
840848 let dateComponents = structure. dateComponentsForPath
841849 let dateFormatter = self . dateFormatter ( timeZone: timeZone)
@@ -851,11 +859,12 @@ extension PHAsset {
851859
852860 // Postfix media type
853861 switch structure {
854- case . byDateAndType, . byType, . byDateComponentAndType, . byYearAndType, . byYearMonthAndType:
862+ case . byDateAndType, . byType, . byDateComponentAndType, . byYearAndType, . byYearMonthAndType, . byYearDashMonthAndType :
855863 if self . mediaType == . video {
856864 components. append ( " Video " )
857865 }
858- case . byDate, . singleFolder, . singleFolderDatePrefixed, . byDateComponent, . byYear, . byYearMonth: break
866+ case . byDate, . singleFolder, . singleFolderDatePrefixed, . byDateComponent, . byYear, . byYearMonth, . byYearDashMonth:
867+ break
859868 }
860869
861870 return components
@@ -868,9 +877,10 @@ extension PHAsset {
868877 {
869878 var path = self . directoryPathInFolder ( structure: structure, subdirectoryPath: subdirectoryPath, timeZone: timeZone)
870879 switch structure {
871- case . byDateAndType, . byType, . byDateComponentAndType, . byYearAndType, . byYearMonthAndType:
880+ case . byDateAndType, . byType, . byDateComponentAndType, . byYearAndType, . byYearMonthAndType, . byYearDashMonthAndType :
872881 path = path. appending ( " Live " , isDirectory: true )
873- case . byDate, . singleFolder, . singleFolderDatePrefixed, . byDateComponent, . byYear, . byYearMonth: break
882+ case . byDate, . singleFolder, . singleFolderDatePrefixed, . byDateComponent, . byYear, . byYearMonth, . byYearDashMonth:
883+ break
874884 }
875885 return path
876886 }
@@ -888,7 +898,7 @@ extension PHAsset {
888898 func fileNameInFolder( structure: PhotoBackupFolderStructure ) -> String {
889899 switch structure {
890900 case . byDate, . byDateAndType, . byDateComponent, . byDateComponentAndType, . singleFolder, . byType, . byYear,
891- . byYearMonth, . byYearAndType, . byYearMonthAndType:
901+ . byYearMonth, . byYearAndType, . byYearMonthAndType, . byYearDashMonth , . byYearDashMonthAndType :
892902 return self . originalFilename
893903
894904 case . singleFolderDatePrefixed:
0 commit comments