Albums: Restore deleted album when trying to create it again #2429

This commit is contained in:
Michael Mayer 2022-06-16 18:59:03 +02:00
parent d769a1e38b
commit acc779f107
12 changed files with 193 additions and 193 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-09 00:51+0000\n" "POT-Creation-Date: 2022-06-16 16:58+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,313 +17,323 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: messages.go:83 #: messages.go:85
msgid "Unexpected error, please try again" msgid "Unexpected error, please try again"
msgstr "" msgstr ""
#: messages.go:84 #: messages.go:86
msgid "Invalid request" msgid "Invalid request"
msgstr "" msgstr ""
#: messages.go:85 #: messages.go:87
msgid "Changes could not be saved" msgid "Changes could not be saved"
msgstr "" msgstr ""
#: messages.go:86 #: messages.go:88
msgid "Could not be deleted" msgid "Could not be deleted"
msgstr "" msgstr ""
#: messages.go:87 #: messages.go:89
#, c-format #, c-format
msgid "%s already exists" msgid "%s already exists"
msgstr "" msgstr ""
#: messages.go:88 #: messages.go:90
msgid "Not found" msgid "Not found"
msgstr "" msgstr ""
#: messages.go:89 #: messages.go:91
msgid "File not found" msgid "File not found"
msgstr "" msgstr ""
#: messages.go:90 #: messages.go:92
msgid "Selection not found" msgid "Selection not found"
msgstr "" msgstr ""
#: messages.go:91 #: messages.go:93
msgid "Entity not found" msgid "Entity not found"
msgstr "" msgstr ""
#: messages.go:92 #: messages.go:94
msgid "Account not found" msgid "Account not found"
msgstr "" msgstr ""
#: messages.go:93 #: messages.go:95
msgid "User not found" msgid "User not found"
msgstr "" msgstr ""
#: messages.go:94 #: messages.go:96
msgid "Label not found" msgid "Label not found"
msgstr "" msgstr ""
#: messages.go:95 #: messages.go:97
msgid "Album not found" msgid "Album not found"
msgstr "" msgstr ""
#: messages.go:96 #: messages.go:98
msgid "Subject not found" msgid "Subject not found"
msgstr "" msgstr ""
#: messages.go:97 #: messages.go:99
msgid "Person not found" msgid "Person not found"
msgstr "" msgstr ""
#: messages.go:98 #: messages.go:100
msgid "Face not found" msgid "Face not found"
msgstr "" msgstr ""
#: messages.go:99 #: messages.go:101
msgid "Not available in public mode" msgid "Not available in public mode"
msgstr "" msgstr ""
#: messages.go:100 #: messages.go:102
msgid "not available in read-only mode" msgid "not available in read-only mode"
msgstr "" msgstr ""
#: messages.go:101 #: messages.go:103
msgid "Please log in and try again" msgid "Please log in and try again"
msgstr "" msgstr ""
#: messages.go:102 #: messages.go:104
msgid "Upload might be offensive" msgid "Upload might be offensive"
msgstr "" msgstr ""
#: messages.go:103 #: messages.go:105
msgid "No items selected" msgid "No items selected"
msgstr "" msgstr ""
#: messages.go:104 #: messages.go:106
msgid "Failed creating file, please check permissions" msgid "Failed creating file, please check permissions"
msgstr "" msgstr ""
#: messages.go:105 #: messages.go:107
msgid "Failed creating folder, please check permissions" msgid "Failed creating folder, please check permissions"
msgstr "" msgstr ""
#: messages.go:106 #: messages.go:108
msgid "Could not connect, please try again" msgid "Could not connect, please try again"
msgstr "" msgstr ""
#: messages.go:107 #: messages.go:109
msgid "Invalid password, please try again" msgid "Invalid password, please try again"
msgstr "" msgstr ""
#: messages.go:108 #: messages.go:110
msgid "Feature disabled" msgid "Feature disabled"
msgstr "" msgstr ""
#: messages.go:109 #: messages.go:111
msgid "No labels selected" msgid "No labels selected"
msgstr "" msgstr ""
#: messages.go:110 #: messages.go:112
msgid "No albums selected" msgid "No albums selected"
msgstr "" msgstr ""
#: messages.go:111 #: messages.go:113
msgid "No files available for download" msgid "No files available for download"
msgstr "" msgstr ""
#: messages.go:112 #: messages.go:114
msgid "Failed to create zip file" msgid "Failed to create zip file"
msgstr "" msgstr ""
#: messages.go:113 #: messages.go:115
msgid "Invalid credentials" msgid "Invalid credentials"
msgstr "" msgstr ""
#: messages.go:114 #: messages.go:116
msgid "Invalid link" msgid "Invalid link"
msgstr "" msgstr ""
#: messages.go:115 #: messages.go:117
msgid "Invalid name" msgid "Invalid name"
msgstr "" msgstr ""
#: messages.go:116 #: messages.go:118
msgid "Busy, please try again later" msgid "Busy, please try again later"
msgstr "" msgstr ""
#: messages.go:119 #: messages.go:119
msgid "Changes successfully saved" #, c-format
msgstr "" msgid "The wakeup interval is %s, but must be 1h or less"
#: messages.go:120
msgid "Album created"
msgstr ""
#: messages.go:121
msgid "Album saved"
msgstr "" msgstr ""
#: messages.go:122 #: messages.go:122
msgid "Changes successfully saved"
msgstr ""
#: messages.go:123
msgid "Album created"
msgstr ""
#: messages.go:124
msgid "Album saved"
msgstr ""
#: messages.go:125
#, c-format #, c-format
msgid "Album %s deleted" msgid "Album %s deleted"
msgstr "" msgstr ""
#: messages.go:123 #: messages.go:126
msgid "Album contents cloned" msgid "Album contents cloned"
msgstr "" msgstr ""
#: messages.go:124 #: messages.go:127
msgid "File removed from stack" msgid "File removed from stack"
msgstr "" msgstr ""
#: messages.go:125
msgid "File deleted"
msgstr ""
#: messages.go:126
#, c-format
msgid "Selection added to %s"
msgstr ""
#: messages.go:127
#, c-format
msgid "One entry added to %s"
msgstr ""
#: messages.go:128 #: messages.go:128
#, c-format msgid "File deleted"
msgid "%d entries added to %s"
msgstr "" msgstr ""
#: messages.go:129 #: messages.go:129
#, c-format #, c-format
msgid "One entry removed from %s" msgid "Selection added to %s"
msgstr "" msgstr ""
#: messages.go:130 #: messages.go:130
#, c-format #, c-format
msgid "%d entries removed from %s" msgid "One entry added to %s"
msgstr "" msgstr ""
#: messages.go:131 #: messages.go:131
msgid "Account created" #, c-format
msgid "%d entries added to %s"
msgstr "" msgstr ""
#: messages.go:132 #: messages.go:132
msgid "Account saved" #, c-format
msgid "One entry removed from %s"
msgstr "" msgstr ""
#: messages.go:133 #: messages.go:133
msgid "Account deleted" #, c-format
msgid "%d entries removed from %s"
msgstr "" msgstr ""
#: messages.go:134 #: messages.go:134
msgid "Settings saved" msgid "Account created"
msgstr "" msgstr ""
#: messages.go:135 #: messages.go:135
msgid "Password changed" msgid "Account saved"
msgstr "" msgstr ""
#: messages.go:136 #: messages.go:136
msgid "Account deleted"
msgstr ""
#: messages.go:137
msgid "Settings saved"
msgstr ""
#: messages.go:138
msgid "Password changed"
msgstr ""
#: messages.go:139
#, c-format #, c-format
msgid "Import completed in %d s" msgid "Import completed in %d s"
msgstr "" msgstr ""
#: messages.go:137 #: messages.go:140
msgid "Import canceled" msgid "Import canceled"
msgstr "" msgstr ""
#: messages.go:138 #: messages.go:141
#, c-format #, c-format
msgid "Indexing completed in %d s" msgid "Indexing completed in %d s"
msgstr "" msgstr ""
#: messages.go:139
msgid "Indexing originals..."
msgstr ""
#: messages.go:140
#, c-format
msgid "Indexing files in %s"
msgstr ""
#: messages.go:141
msgid "Indexing canceled"
msgstr ""
#: messages.go:142 #: messages.go:142
#, c-format msgid "Indexing originals..."
msgid "Removed %d files and %d photos"
msgstr "" msgstr ""
#: messages.go:143 #: messages.go:143
#, c-format #, c-format
msgid "Moving files from %s" msgid "Indexing files in %s"
msgstr "" msgstr ""
#: messages.go:144 #: messages.go:144
msgid "Indexing canceled"
msgstr ""
#: messages.go:145
#, c-format
msgid "Removed %d files and %d photos"
msgstr ""
#: messages.go:146
#, c-format
msgid "Moving files from %s"
msgstr ""
#: messages.go:147
#, c-format #, c-format
msgid "Copying files from %s" msgid "Copying files from %s"
msgstr "" msgstr ""
#: messages.go:145 #: messages.go:148
msgid "Labels deleted" msgid "Labels deleted"
msgstr "" msgstr ""
#: messages.go:146 #: messages.go:149
msgid "Label saved" msgid "Label saved"
msgstr "" msgstr ""
#: messages.go:147 #: messages.go:150
msgid "Subject saved" msgid "Subject saved"
msgstr "" msgstr ""
#: messages.go:148 #: messages.go:151
msgid "Subject deleted" msgid "Subject deleted"
msgstr "" msgstr ""
#: messages.go:149 #: messages.go:152
msgid "Person saved" msgid "Person saved"
msgstr "" msgstr ""
#: messages.go:150 #: messages.go:153
msgid "Person deleted" msgid "Person deleted"
msgstr "" msgstr ""
#: messages.go:151 #: messages.go:154
#, c-format #, c-format
msgid "%d files uploaded in %d s" msgid "%d files uploaded in %d s"
msgstr "" msgstr ""
#: messages.go:152 #: messages.go:155
msgid "Selection approved" msgid "Selection approved"
msgstr "" msgstr ""
#: messages.go:153 #: messages.go:156
msgid "Selection archived" msgid "Selection archived"
msgstr "" msgstr ""
#: messages.go:154 #: messages.go:157
msgid "Selection restored" msgid "Selection restored"
msgstr "" msgstr ""
#: messages.go:155 #: messages.go:158
msgid "Selection marked as private" msgid "Selection marked as private"
msgstr "" msgstr ""
#: messages.go:156 #: messages.go:159
msgid "Albums deleted" msgid "Albums deleted"
msgstr "" msgstr ""
#: messages.go:157 #: messages.go:160
#, c-format #, c-format
msgid "Zip created in %d s" msgid "Zip created in %d s"
msgstr "" msgstr ""
#: messages.go:158 #: messages.go:161
msgid "Permanently deleted" msgid "Permanently deleted"
msgstr "" msgstr ""
#: messages.go:162
#, c-format
msgid "%s has been restored"
msgstr ""

View file

@ -63,7 +63,6 @@ module.exports = (config) => {
}, },
files: [ files: [
"node_modules/@babel/polyfill/dist/polyfill.js",
"node_modules/regenerator-runtime/runtime/runtime.js", "node_modules/regenerator-runtime/runtime/runtime.js",
{ pattern: "tests/unit/**/*_test.js", watched: false }, { pattern: "tests/unit/**/*_test.js", watched: false },
], ],

View file

@ -15,7 +15,6 @@
"@babel/plugin-proposal-class-properties": "^7.17.12", "@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-object-rest-spread": "^7.18.0", "@babel/plugin-proposal-object-rest-spread": "^7.18.0",
"@babel/plugin-transform-runtime": "^7.18.2", "@babel/plugin-transform-runtime": "^7.18.2",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.18.2", "@babel/preset-env": "^7.18.2",
"@babel/register": "^7.17.7", "@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.3", "@babel/runtime": "^7.18.3",
@ -1497,23 +1496,6 @@
"@babel/core": "^7.0.0-0" "@babel/core": "^7.0.0-0"
} }
}, },
"node_modules/@babel/polyfill": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz",
"integrity": "sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==",
"deprecated": "🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.",
"dependencies": {
"core-js": "^2.6.5",
"regenerator-runtime": "^0.13.4"
}
},
"node_modules/@babel/polyfill/node_modules/core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
"deprecated": "core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.",
"hasInstallScript": true
},
"node_modules/@babel/preset-env": { "node_modules/@babel/preset-env": {
"version": "7.18.2", "version": "7.18.2",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.2.tgz", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.2.tgz",
@ -3399,9 +3381,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001354", "version": "1.0.30001355",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001354.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001355.tgz",
"integrity": "sha512-mImKeCkyGDAHNywYFA4bqnLAzTUvVkqPvhY4DV47X+Gl2c5Z8c3KNETnXp14GQt11LvxE8AwjzGxJ+rsikiOzg==", "integrity": "sha512-Sd6pjJHF27LzCB7pT7qs+kuX2ndurzCzkpJl6Qct7LPSZ9jn0bkOA8mdgMgmqnQAWLVOOGjLpc+66V57eLtb1g==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@ -4550,9 +4532,9 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.4.157", "version": "1.4.158",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.157.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.158.tgz",
"integrity": "sha512-gteFnXPKsDAdm1U5vVuyrLnKOaR/x/SY+HjUQoHypLUYWJt4RaWU3PaiTBEkRDJh8/Zd8KC/EFjV+uPaHsjKFA==" "integrity": "sha512-gppO3/+Y6sP432HtvwvuU8S+YYYLH4PmAYvQwqUtt9HDOmEsBwQfLnK9T8+1NIKwAS1BEygIjTaATC4H5EzvxQ=="
}, },
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
"version": "8.0.0", "version": "8.0.0",
@ -5197,9 +5179,9 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
}, },
"node_modules/eslint-plugin-n": { "node_modules/eslint-plugin-n": {
"version": "15.2.2", "version": "15.2.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.2.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.3.tgz",
"integrity": "sha512-MLjZVAv4TiCIoXqjibNqCJjLkGHfrOY3XZ0ZBLoW0OnS3o98PUBnzB/kfp8dCz/4A4Y18jjX50PRnqI4ACFY1Q==", "integrity": "sha512-H+KC7U5R+3IWTeRnACm/4wlqLvS1Q7M6t7BGhn89qXDkZan8HTAEv3ouIONA0ifDwc2YzPFmyPzHuNLddNK4jw==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"builtins": "^5.0.1", "builtins": "^5.0.1",
@ -10140,9 +10122,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.7.0", "version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.0.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
"integrity": "sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ==", "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==",
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin-prettier.js"
}, },
@ -13924,22 +13906,6 @@
"@babel/helper-plugin-utils": "^7.16.7" "@babel/helper-plugin-utils": "^7.16.7"
} }
}, },
"@babel/polyfill": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz",
"integrity": "sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==",
"requires": {
"core-js": "^2.6.5",
"regenerator-runtime": "^0.13.4"
},
"dependencies": {
"core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
}
}
},
"@babel/preset-env": { "@babel/preset-env": {
"version": "7.18.2", "version": "7.18.2",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.2.tgz", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.2.tgz",
@ -15379,9 +15345,9 @@
} }
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001354", "version": "1.0.30001355",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001354.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001355.tgz",
"integrity": "sha512-mImKeCkyGDAHNywYFA4bqnLAzTUvVkqPvhY4DV47X+Gl2c5Z8c3KNETnXp14GQt11LvxE8AwjzGxJ+rsikiOzg==" "integrity": "sha512-Sd6pjJHF27LzCB7pT7qs+kuX2ndurzCzkpJl6Qct7LPSZ9jn0bkOA8mdgMgmqnQAWLVOOGjLpc+66V57eLtb1g=="
}, },
"chai": { "chai": {
"version": "4.3.6", "version": "4.3.6",
@ -16200,9 +16166,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.4.157", "version": "1.4.158",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.157.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.158.tgz",
"integrity": "sha512-gteFnXPKsDAdm1U5vVuyrLnKOaR/x/SY+HjUQoHypLUYWJt4RaWU3PaiTBEkRDJh8/Zd8KC/EFjV+uPaHsjKFA==" "integrity": "sha512-gppO3/+Y6sP432HtvwvuU8S+YYYLH4PmAYvQwqUtt9HDOmEsBwQfLnK9T8+1NIKwAS1BEygIjTaATC4H5EzvxQ=="
}, },
"emoji-regex": { "emoji-regex": {
"version": "8.0.0", "version": "8.0.0",
@ -16787,9 +16753,9 @@
} }
}, },
"eslint-plugin-n": { "eslint-plugin-n": {
"version": "15.2.2", "version": "15.2.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.2.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.3.tgz",
"integrity": "sha512-MLjZVAv4TiCIoXqjibNqCJjLkGHfrOY3XZ0ZBLoW0OnS3o98PUBnzB/kfp8dCz/4A4Y18jjX50PRnqI4ACFY1Q==", "integrity": "sha512-H+KC7U5R+3IWTeRnACm/4wlqLvS1Q7M6t7BGhn89qXDkZan8HTAEv3ouIONA0ifDwc2YzPFmyPzHuNLddNK4jw==",
"peer": true, "peer": true,
"requires": { "requires": {
"builtins": "^5.0.1", "builtins": "^5.0.1",
@ -20089,9 +20055,9 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
}, },
"prettier": { "prettier": {
"version": "2.7.0", "version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.0.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
"integrity": "sha512-nwoX4GMFgxoPC6diHvSwmK/4yU8FFH3V8XWtLQrbj4IBsK2pkYhG4kf/ljF/haaZ/aii+wNJqISrCDPgxGWDVQ==" "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g=="
}, },
"prettier-linter-helpers": { "prettier-linter-helpers": {
"version": "1.0.0", "version": "1.0.0",

View file

@ -30,7 +30,6 @@
"@babel/plugin-proposal-class-properties": "^7.17.12", "@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-object-rest-spread": "^7.18.0", "@babel/plugin-proposal-object-rest-spread": "^7.18.0",
"@babel/plugin-transform-runtime": "^7.18.2", "@babel/plugin-transform-runtime": "^7.18.2",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.18.2", "@babel/preset-env": "^7.18.2",
"@babel/register": "^7.17.7", "@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.3", "@babel/runtime": "^7.18.3",
@ -42,13 +41,13 @@
"babel-plugin-istanbul": "^6.1.1", "babel-plugin-istanbul": "^6.1.1",
"browserslist": "^4.20.4", "browserslist": "^4.20.4",
"chai": "^4.3.6", "chai": "^4.3.6",
"cheerio": "1.0.0-rc.10",
"chrome-finder": "^1.0.7", "chrome-finder": "^1.0.7",
"core-js": "^3.23.1", "core-js": "^3.23.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"cssnano": "^5.1.11", "cssnano": "^5.1.11",
"easygettext": "^2.17.0", "easygettext": "^2.17.0",
"cheerio": "1.0.0-rc.10",
"eslint": "^8.17.0", "eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0", "eslint-config-standard": "^17.0.0",

View file

@ -205,7 +205,7 @@ msgstr ""
#: src/component/photo/toolbar.vue:39 #: src/component/photo/toolbar.vue:39
#: src/pages/albums.vue:29 #: src/pages/albums.vue:29
#: src/pages/albums.vue:494 #: src/pages/albums.vue:496
#: src/share/albums.vue:27 #: src/share/albums.vue:27
#: src/share/albums.vue:410 #: src/share/albums.vue:410
msgid "All Categories" msgid "All Categories"

View file

@ -677,9 +677,11 @@ export default {
this.lastId = ""; this.lastId = "";
}, },
onUpdate(ev, data) { onUpdate(ev, data) {
if (!this.listen) return; if (!this.listen) {
console.log("albums.onUpdate currently not listening", ev, data);
if (!data || !data.entities || !Array.isArray(data.entities)) { return;
} else if (!data || !data.entities || !Array.isArray(data.entities)) {
console.log("albums.onUpdate received empty data", ev, data);
return; return;
} }

9
go.mod
View file

@ -41,7 +41,6 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/paulmach/go.geojson v1.4.0 github.com/paulmach/go.geojson v1.4.0
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/sevlyar/go-daemon v0.1.5 github.com/sevlyar/go-daemon v0.1.5
github.com/sirupsen/logrus v1.8.1 github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.2 github.com/stretchr/testify v1.7.2
@ -68,6 +67,12 @@ require (
github.com/olekukonko/tablewriter v0.0.5 github.com/olekukonko/tablewriter v0.0.5
) )
require (
github.com/google/uuid v1.3.0
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect
)
require ( require (
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
@ -84,14 +89,12 @@ require (
github.com/mandykoh/go-parallel v0.1.0 // indirect github.com/mandykoh/go-parallel v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-isatty v0.0.14 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect github.com/tidwall/pretty v1.2.0 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect github.com/ugorji/go/codec v1.2.7 // indirect
golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect
golang.org/x/text v0.3.7 // indirect golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.28.0 // indirect google.golang.org/protobuf v1.28.0 // indirect

4
go.sum
View file

@ -168,6 +168,8 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
@ -283,8 +285,6 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfF
github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM=
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
github.com/sevlyar/go-daemon v0.1.5 h1:Zy/6jLbM8CfqJ4x4RPr7MJlSKt90f00kNM1D401C+Qk= github.com/sevlyar/go-daemon v0.1.5 h1:Zy/6jLbM8CfqJ4x4RPr7MJlSKt90f00kNM1D401C+Qk=
github.com/sevlyar/go-daemon v0.1.5/go.mod h1:6dJpPatBT9eUwM5VCw9Bt6CdX9Tk6UWvhW3MebLDRKE= github.com/sevlyar/go-daemon v0.1.5/go.mod h1:6dJpPatBT9eUwM5VCw9Bt6CdX9Tk6UWvhW3MebLDRKE=

View file

@ -88,26 +88,42 @@ func CreateAlbum(router *gin.RouterGroup) {
a := entity.NewAlbum(f.AlbumTitle, entity.AlbumDefault) a := entity.NewAlbum(f.AlbumTitle, entity.AlbumDefault)
a.AlbumFavorite = f.AlbumFavorite a.AlbumFavorite = f.AlbumFavorite
// Search existing album. // Existing album?
if err := a.Find(); err == nil { if err := a.Find(); err != nil {
c.JSON(http.StatusOK, a) // Not found, create new album.
return err = a.Create()
// Should never happen.
if err != nil {
// Report unexpected error.
log.Errorf("album: %s (create)", err)
AbortUnexpected(c)
return
}
event.SuccessMsg(i18n.MsgAlbumCreated)
} else {
// Exists, restore if necessary.
if !a.Deleted() {
event.InfoMsg(i18n.ErrAlreadyExists, a.Title())
c.JSON(http.StatusOK, a)
return
} else if err = a.Restore(); err == nil {
event.SuccessMsg(i18n.MsgRestored, a.Title())
} else {
// Report unexpected error.
log.Errorf("album: %s (restore)", err)
AbortUnexpected(c)
return
}
} }
// Create new album. // Publish event and create/update YAML backup.
if err := a.Create(); err != nil {
AbortAlreadyExists(c, clean.Log(a.AlbumTitle))
return
}
event.SuccessMsg(i18n.MsgAlbumCreated)
UpdateClientConfig() UpdateClientConfig()
PublishAlbumEvent(EntityCreated, a.AlbumUID, c) PublishAlbumEvent(EntityCreated, a.AlbumUID, c)
SaveAlbumAsYaml(*a) SaveAlbumAsYaml(*a)
// Return as JSON.
c.JSON(http.StatusOK, a) c.JSON(http.StatusOK, a)
}) })
} }

View file

@ -223,8 +223,13 @@ func BatchAlbumsDelete(router *gin.RouterGroup) {
log.Infof("albums: deleting %s", clean.Log(f.String())) log.Infof("albums: deleting %s", clean.Log(f.String()))
// Soft delete albums, can be restored.
entity.Db().Where("album_uid IN (?)", f.Albums).Delete(&entity.Album{}) entity.Db().Where("album_uid IN (?)", f.Albums).Delete(&entity.Album{})
entity.Db().Where("album_uid IN (?)", f.Albums).Delete(&entity.PhotoAlbum{})
/*
KEEP ENTRIES AS ALBUMS MAY NOW BE RESTORED BY NAME
entity.Db().Where("album_uid IN (?)", f.Albums).Delete(&entity.PhotoAlbum{})
*/
UpdateClientConfig() UpdateClientConfig()

View file

@ -77,6 +77,7 @@ const (
MsgAlbumsDeleted MsgAlbumsDeleted
MsgZipCreatedIn MsgZipCreatedIn
MsgPermanentlyDeleted MsgPermanentlyDeleted
MsgRestored
) )
var Messages = MessageMap{ var Messages = MessageMap{
@ -158,4 +159,5 @@ var Messages = MessageMap{
MsgAlbumsDeleted: gettext("Albums deleted"), MsgAlbumsDeleted: gettext("Albums deleted"),
MsgZipCreatedIn: gettext("Zip created in %d s"), MsgZipCreatedIn: gettext("Zip created in %d s"),
MsgPermanentlyDeleted: gettext("Permanently deleted"), MsgPermanentlyDeleted: gettext("Permanently deleted"),
MsgRestored: gettext("%s has been restored"),
} }

View file

@ -1,14 +1,12 @@
package rnd package rnd
import ( import (
uuid "github.com/satori/go.uuid" "github.com/google/uuid"
) )
// UUID returns a standard, random UUID as string. // UUID returns a random string based on RFC 4122 (UUID Version 4) or panics.
//
// The strength of the UUID depends on the "crypto/rand" package.
func UUID() string { func UUID() string {
if id, err := uuid.NewV4(); err != nil { return uuid.NewString()
return ""
} else {
return id.String()
}
} }