diff --git a/Makefile b/Makefile index 60cbd8221..79d7e7037 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,17 @@ +.PHONY: ; +.SILENT: ; # no need for @ +.ONESHELL: ; # recipes execute in same shell +.NOTPARALLEL: ; # wait for target to finish +.EXPORT_ALL_VARIABLES: ; # send all vars to shell + export GO111MODULE=on + GOIMPORTS=goimports BINARY_NAME=photoprism DOCKER_TAG=`date -u +%Y%m%d` HASRICHGO := $(shell which richgo) + ifdef HASRICHGO GOTEST=richgo test else @@ -67,7 +75,7 @@ clean-local-cache: clean-local-config: rm -f ~/.photoprism/storage/settings/* dep-js: - (cd frontend && npm install --silent) + (cd frontend && npm install --silent && npm audit fix) dep-go: go build -v ./... dep-upgrade: diff --git a/assets/locales/messages.pot b/assets/locales/messages.pot index 996c7622d..e087bfad7 100644 --- a/assets/locales/messages.pot +++ b/assets/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-29 13:42+0000\n" +"POT-Creation-Date: 2020-08-17 19:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/docker-compose.drone.yml b/docker-compose.drone.yml index d9bc8a058..c19e91c61 100644 --- a/docker-compose.drone.yml +++ b/docker-compose.drone.yml @@ -128,7 +128,7 @@ services: photoprism-db: image: mariadb:10.5 - command: mysqld --port=4001 --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1024 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 + command: mysqld --port=4001 --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 expose: - "4001" volumes: diff --git a/docker-compose.yml b/docker-compose.yml index c1bbf4466..d343a6023 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: photoprism-db: image: mariadb:10.5 - command: mysqld --port=4001 --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1024 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 + command: mysqld --port=4001 --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 expose: - "4001" ports: diff --git a/docker/photoprism/arm64/docker-compose.yml b/docker/photoprism/arm64/docker-compose.yml index 44f0924a2..1073dff9e 100644 --- a/docker/photoprism/arm64/docker-compose.yml +++ b/docker/photoprism/arm64/docker-compose.yml @@ -63,7 +63,7 @@ services: # photoprism-db: # image: mariadb:10.5 # Alternatively mysql:8.0 # restart: unless-stopped -# command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1024 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 +# command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 # volumes: # - "/var/lib/mysql" # environment: diff --git a/docker/photoprism/docker-compose.yml b/docker/photoprism/docker-compose.yml index f8a696000..ec75beedb 100644 --- a/docker/photoprism/docker-compose.yml +++ b/docker/photoprism/docker-compose.yml @@ -61,7 +61,7 @@ services: # photoprism-db: # image: mariadb:10.5 # Alternatively mysql:8.0 # restart: unless-stopped -# command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=1024 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 +# command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50 # volumes: # - "/var/lib/mysql" # environment: diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 84f2d1f54..3e01457aa 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -2055,9 +2055,9 @@ } }, "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -5069,9 +5069,9 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", + "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", @@ -8882,9 +8882,9 @@ } }, "minizlib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz", - "integrity": "sha512-EzTZN/fjSvifSX0SlqUERCN39o6T40AMarPbv0MrarSFtIITCBh7bi+dU8nxGFHuqs9jdIAeoYoKuQAAASsPPA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "requires": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -11082,9 +11082,9 @@ } }, "pubsub-js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.8.0.tgz", - "integrity": "sha512-z/61CZMA+jaQpBU0QSWkC4w6lX3tPbOdtl1h2UWac4sn6dkWfx7ND75SsN6U0amczdI66PqfuXXD0Ad7tnbaQg==" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.0.tgz", + "integrity": "sha512-bBGaOnAdkn3jhZC71mhjNB4mxQAOM99GTh/NoVuf/VXWUuQAZJGWIkEJlkXi0ACdKx3z65u5qilWaE5G4mMQOw==" }, "pug": { "version": "2.0.4", @@ -12984,14 +12984,14 @@ "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" }, "tar": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", - "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.5.tgz", + "integrity": "sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^3.0.0", - "minizlib": "^2.1.0", + "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, diff --git a/frontend/package.json b/frontend/package.json index 320b4f060..cc319e071 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,7 +28,7 @@ "@babel/runtime": "^7.11.2", "@fortawesome/fontawesome-free": "^5.14.0", "acorn": "^6.4.1", - "ajv": "^6.12.3", + "ajv": "^6.12.4", "autoprefixer": "^9.8.6", "axios": "^0.19.2", "axios-mock-adapter": "^1.18.2", @@ -49,7 +49,7 @@ "css-loader": "^2.1.1", "cssnano": "^4.1.10", "easygettext": "^2.14.0", - "eslint": "^7.6.0", + "eslint": "^7.7.0", "eslint-config-standard": "^14.1.1", "eslint-formatter-pretty": "^4.0.0", "eslint-friendly-formatter": "^4.0.1", @@ -93,7 +93,7 @@ "postcss-preset-env": "^6.7.0", "postcss-reporter": "^6.0.1", "postcss-url": "^8.0.0", - "pubsub-js": "^1.8.0", + "pubsub-js": "^1.9.0", "puppeteer-core": "^5.2.1", "regenerator-runtime": "^0.13.7", "resolve-url-loader": "^3.1.1", @@ -104,7 +104,7 @@ "style-loader": "^0.23.1", "sugarss": "^2.0.0", "svg-url-loader": "^5.0.1", - "tar": "^6.0.2", + "tar": "^6.0.5", "truncate": "^2.1.0", "url-loader": "^1.1.2", "vue": "^2.6.11", diff --git a/frontend/src/dialog/photo/files.vue b/frontend/src/dialog/photo/files.vue index 029e7af36..e22280c14 100644 --- a/frontend/src/dialog/photo/files.vue +++ b/frontend/src/dialog/photo/files.vue @@ -61,13 +61,19 @@ - - UID + + UID {{ file.UID | uppercase }} - + + Instance ID + + {{ file.InstanceID | uppercase }} + + + Hash {{ file.Hash }} diff --git a/frontend/src/locales/translations.pot b/frontend/src/locales/translations.pot index 928a1b1f8..c1765e0b5 100644 --- a/frontend/src/locales/translations.pot +++ b/frontend/src/locales/translations.pot @@ -11,7 +11,7 @@ msgid "%{n} albums found" msgstr "" #: src/pages/album/photos.vue:362 -#: src/share/photos.vue:405 +#: src/share/photos.vue:410 msgid "%{n} entries found" msgstr "" @@ -92,7 +92,7 @@ msgstr "" msgid "Add to album" msgstr "" -#: src/dialog/photo/files.vue:138 +#: src/dialog/photo/files.vue:147 msgid "Added" msgstr "" @@ -132,7 +132,7 @@ msgstr "" msgid "Album" msgstr "" -#: src/component/album/toolbar.vue:115 +#: src/component/album/toolbar.vue:120 #: src/dialog/photo/album.vue:61 #: src/pages/albums.vue:256 #: src/share/albums.vue:154 @@ -157,7 +157,7 @@ msgid "All %{n} albums loaded" msgstr "" #: src/pages/album/photos.vue:251 -#: src/share/photos.vue:294 +#: src/share/photos.vue:299 msgid "All %{n} entries loaded" msgstr "" @@ -165,7 +165,7 @@ msgstr "" msgid "All %{n} labels loaded" msgstr "" -#: src/component/album/toolbar.vue:79 +#: src/component/album/toolbar.vue:84 #: src/component/photo/toolbar.vue:174 msgid "All Cameras" msgstr "" @@ -181,7 +181,7 @@ msgstr "" msgid "All Colors" msgstr "" -#: src/component/album/toolbar.vue:83 +#: src/component/album/toolbar.vue:88 #: src/component/photo/toolbar.vue:173 msgid "All Countries" msgstr "" @@ -276,7 +276,7 @@ msgstr "" msgid "Artist" msgstr "" -#: src/dialog/photo/files.vue:108 +#: src/dialog/photo/files.vue:117 msgid "Aspect Ratio" msgstr "" @@ -322,7 +322,7 @@ msgstr "" msgid "Calendar" msgstr "" -#: src/component/album/toolbar.vue:120 +#: src/component/album/toolbar.vue:125 #: src/component/photo/list.vue:138 #: src/component/photo/toolbar.vue:201 #: src/dialog/album/edit.vue:126 @@ -337,7 +337,7 @@ msgstr "" #: src/pages/album/photos.vue:257 #: src/pages/photos.vue:292 -#: src/share/photos.vue:300 +#: src/share/photos.vue:305 msgid "Can't load more, limit reached" msgstr "" @@ -356,12 +356,12 @@ msgstr "" msgid "Cancel" msgstr "" -#: src/component/album/toolbar.vue:94 +#: src/component/album/toolbar.vue:99 #: src/component/photo/toolbar.vue:184 msgid "Cards" msgstr "" -#: src/component/album/toolbar.vue:122 +#: src/component/album/toolbar.vue:127 #: src/component/photo/toolbar.vue:206 #: src/dialog/album/edit.vue:128 #: src/dialog/photo/details.vue:445 @@ -391,7 +391,7 @@ msgstr "" msgid "Chinese" msgstr "" -#: src/dialog/photo/files.vue:120 +#: src/dialog/photo/files.vue:129 msgid "Chroma" msgstr "" @@ -401,7 +401,7 @@ msgstr "" msgid "Close" msgstr "" -#: src/dialog/photo/files.vue:84 +#: src/dialog/photo/files.vue:93 msgid "Codec" msgstr "" @@ -490,7 +490,7 @@ msgstr "" msgid "Couldn't find recently edited" msgstr "" -#: src/component/album/toolbar.vue:119 +#: src/component/album/toolbar.vue:124 #: src/component/photo/toolbar.vue:200 #: src/dialog/album/edit.vue:125 #: src/dialog/photo/details.vue:440 @@ -547,7 +547,7 @@ msgstr "" msgid "Delete" msgstr "" -#: src/component/album/toolbar.vue:116 +#: src/component/album/toolbar.vue:121 #: src/dialog/album/edit.vue:122 #: src/dialog/photo/details.vue:462 msgid "Description" @@ -561,7 +561,7 @@ msgstr "" msgid "Details" msgstr "" -#: src/dialog/photo/files.vue:205 +#: src/dialog/photo/files.vue:215 msgid "Dimensions" msgstr "" @@ -589,12 +589,15 @@ msgid "Done." msgstr "" #: src/component/album/clipboard.vue:115 +#: src/component/album/toolbar.vue:89 #: src/component/file/clipboard.vue:78 #: src/component/label/clipboard.vue:91 #: src/component/photo/clipboard.vue:157 +#: src/dialog/photo/files.vue:33 #: src/pages/settings/general.vue:351 #: src/share/album/clipboard.vue:70 #: src/share/photo/clipboard.vue:76 +#: src/share/photos.vue:68 msgid "Download" msgstr "" @@ -607,12 +610,14 @@ msgid "Download single files and zip archives." msgstr "" #: src/component/album/clipboard.vue:181 +#: src/component/album/toolbar.vue:174 #: src/component/file/clipboard.vue:106 #: src/component/label/clipboard.vue:132 #: src/component/photo/clipboard.vue:223 #: src/component/photo/viewer.vue:163 #: src/share/album/clipboard.vue:93 #: src/share/photo/clipboard.vue:97 +#: src/share/photos.vue:531 msgid "Downloading…" msgstr "" @@ -656,7 +661,7 @@ msgstr "" msgid "English" msgstr "" -#: src/dialog/photo/files.vue:126 +#: src/dialog/photo/files.vue:135 msgid "Error" msgstr "" @@ -792,13 +797,13 @@ msgstr "" msgid "Grey" msgstr "" -#: src/component/album/toolbar.vue:105 +#: src/component/album/toolbar.vue:110 #: src/component/photo/toolbar.vue:193 #: src/dialog/album/edit.vue:115 msgid "Group by similarity" msgstr "" -#: src/dialog/photo/files.vue:48 +#: src/dialog/photo/files.vue:57 msgid "Hash" msgstr "" @@ -868,8 +873,8 @@ msgstr "" msgid "Importing files to originals…" msgstr "" -#: src/dialog/photo/files.vue:140 -#: src/dialog/photo/files.vue:146 +#: src/dialog/photo/files.vue:149 +#: src/dialog/photo/files.vue:155 msgid "in" msgstr "" @@ -889,6 +894,10 @@ msgstr "" msgid "Indexing media and sidecar files…" msgstr "" +#: src/dialog/photo/files.vue:51 +msgid "Instance ID" +msgstr "" + #: src/dialog/account/edit.vue:362 msgid "Interval" msgstr "" @@ -986,7 +995,7 @@ msgstr "" msgid "Link" msgstr "" -#: src/component/album/toolbar.vue:95 +#: src/component/album/toolbar.vue:100 #: src/component/photo/toolbar.vue:185 msgid "List" msgstr "" @@ -1035,7 +1044,7 @@ msgstr "" msgid "Magenta" msgstr "" -#: src/dialog/photo/files.vue:114 +#: src/dialog/photo/files.vue:123 msgid "Main Color" msgstr "" @@ -1051,7 +1060,7 @@ msgstr "" msgid "Medium" msgstr "" -#: src/dialog/photo/files.vue:132 +#: src/dialog/photo/files.vue:141 msgid "Missing" msgstr "" @@ -1086,7 +1095,7 @@ msgid "More than 20 labels found" msgstr "" #: src/pages/album/photos.vue:365 -#: src/share/photos.vue:408 +#: src/share/photos.vue:413 msgid "More than 50 entries found" msgstr "" @@ -1094,12 +1103,12 @@ msgstr "" msgid "More than 50 results" msgstr "" -#: src/component/album/toolbar.vue:93 +#: src/component/album/toolbar.vue:98 #: src/component/photo/toolbar.vue:183 msgid "Mosaic" msgstr "" -#: src/component/album/toolbar.vue:106 +#: src/component/album/toolbar.vue:111 #: src/component/photo/toolbar.vue:194 #: src/dialog/album/edit.vue:116 msgid "Most relevant" @@ -1126,15 +1135,15 @@ msgstr[1] "" #: src/component/photo/list.vue:140 #: src/dialog/account/edit.vue:488 #: src/dialog/album/edit.vue:121 -#: src/dialog/photo/files.vue:60 -#: src/dialog/photo/files.vue:204 +#: src/dialog/photo/files.vue:69 +#: src/dialog/photo/files.vue:214 #: src/dialog/photo/info.vue:30 #: src/pages/login.vue:72 #: src/share/photo/list.vue:117 msgid "Name" msgstr "" -#: src/component/album/toolbar.vue:124 +#: src/component/album/toolbar.vue:129 #: src/dialog/album/edit.vue:119 #: src/dialog/photo/labels.vue:117 #: src/pages/labels.vue:199 @@ -1152,7 +1161,7 @@ msgstr "" msgid "New Password" msgstr "" -#: src/component/album/toolbar.vue:102 +#: src/component/album/toolbar.vue:107 #: src/component/photo/toolbar.vue:190 #: src/dialog/album/edit.vue:112 msgid "Newest first" @@ -1172,7 +1181,7 @@ msgid "No albums found" msgstr "" #: src/pages/album/photos.vue:358 -#: src/share/photos.vue:401 +#: src/share/photos.vue:406 msgid "No entries found" msgstr "" @@ -1250,7 +1259,7 @@ msgstr "" msgid "Offline" msgstr "" -#: src/component/album/toolbar.vue:103 +#: src/component/album/toolbar.vue:108 #: src/component/photo/toolbar.vue:191 #: src/dialog/album/edit.vue:113 msgid "Oldest first" @@ -1266,7 +1275,7 @@ msgid "One album found" msgstr "" #: src/pages/album/photos.vue:360 -#: src/share/photos.vue:403 +#: src/share/photos.vue:408 msgid "One entry found" msgstr "" @@ -1298,7 +1307,7 @@ msgstr "" msgid "Original file names will be stored and indexed." msgstr "" -#: src/dialog/photo/files.vue:66 +#: src/dialog/photo/files.vue:75 #: src/dialog/photo/info.vue:36 msgid "Original Name" msgstr "" @@ -1392,7 +1401,7 @@ msgstr "" msgid "Polish" msgstr "" -#: src/dialog/photo/files.vue:96 +#: src/dialog/photo/files.vue:105 msgid "Portrait" msgstr "" @@ -1417,9 +1426,9 @@ msgstr "" msgid "Preview" msgstr "" -#: src/dialog/photo/files.vue:33 -#: src/dialog/photo/files.vue:90 -#: src/dialog/photo/files.vue:198 +#: src/dialog/photo/files.vue:36 +#: src/dialog/photo/files.vue:99 +#: src/dialog/photo/files.vue:208 msgid "Primary" msgstr "" @@ -1429,7 +1438,7 @@ msgstr "" msgid "Private" msgstr "" -#: src/dialog/photo/files.vue:102 +#: src/dialog/photo/files.vue:111 msgid "Projection" msgstr "" @@ -1461,13 +1470,13 @@ msgstr "" msgid "Re-index all originals, including already indexed and unchanged files." msgstr "" -#: src/component/album/toolbar.vue:100 +#: src/component/album/toolbar.vue:105 #: src/component/photo/toolbar.vue:188 #: src/dialog/album/edit.vue:110 msgid "Recently added" msgstr "" -#: src/component/album/toolbar.vue:101 +#: src/component/album/toolbar.vue:106 #: src/component/photo/toolbar.vue:189 #: src/dialog/album/edit.vue:111 msgid "Recently edited" @@ -1545,7 +1554,7 @@ msgstr "" msgid "Scans" msgstr "" -#: src/component/album/toolbar.vue:117 +#: src/component/album/toolbar.vue:122 #: src/component/photo/toolbar.vue:198 #: src/component/photo/toolbar.vue:33 #: src/dialog/album/edit.vue:123 @@ -1573,7 +1582,7 @@ msgstr "" #: src/pages/photos.vue:314 #: src/pages/places.vue:209 #: src/share/albums.vue:280 -#: src/share/photos.vue:322 +#: src/share/photos.vue:327 msgid "Search term too short" msgstr "" @@ -1670,8 +1679,8 @@ msgid "Similar" msgstr "" #: src/dialog/account/edit.vue:261 -#: src/dialog/photo/files.vue:72 -#: src/dialog/photo/files.vue:206 +#: src/dialog/photo/files.vue:81 +#: src/dialog/photo/files.vue:216 msgid "Size" msgstr "" @@ -1679,13 +1688,13 @@ msgstr "" msgid "Slow" msgstr "" -#: src/component/album/toolbar.vue:104 +#: src/component/album/toolbar.vue:109 #: src/component/photo/toolbar.vue:192 #: src/dialog/album/edit.vue:114 msgid "Sort by file name" msgstr "" -#: src/component/album/toolbar.vue:121 +#: src/component/album/toolbar.vue:126 #: src/component/photo/toolbar.vue:207 #: src/dialog/album/edit.vue:127 #: src/dialog/photo/details.vue:446 @@ -1716,11 +1725,11 @@ msgstr "" msgid "States" msgstr "" -#: src/dialog/photo/files.vue:208 +#: src/dialog/photo/files.vue:218 msgid "Status" msgstr "" -#: src/dialog/photo/files.vue:54 +#: src/dialog/photo/files.vue:63 msgid "Storage Folder" msgstr "" @@ -1842,16 +1851,12 @@ msgid "Try again using other filters or keywords." msgstr "" #: src/dialog/account/edit.vue:620 -#: src/dialog/photo/files.vue:78 -#: src/dialog/photo/files.vue:207 +#: src/dialog/photo/files.vue:87 +#: src/dialog/photo/files.vue:217 #: src/dialog/photo/info.vue:15 msgid "Type" msgstr "" -#: src/dialog/photo/files.vue:42 -msgid "UID" -msgstr "" - #: src/dialog/photo/details.vue:432 #: src/dialog/photo/info.vue:254 #: src/model/album.js:122 @@ -1877,11 +1882,11 @@ msgstr "" msgid "Unsorted" msgstr "" -#: src/dialog/photo/files.vue:36 +#: src/dialog/photo/files.vue:39 msgid "Unstack" msgstr "" -#: src/dialog/photo/files.vue:144 +#: src/dialog/photo/files.vue:153 #: src/dialog/photo/info.vue:157 msgid "Updated" msgstr "" @@ -1959,7 +1964,7 @@ msgstr "" msgid "Videos" msgstr "" -#: src/component/album/toolbar.vue:118 +#: src/component/album/toolbar.vue:123 #: src/component/photo/toolbar.vue:199 #: src/dialog/album/edit.vue:124 #: src/dialog/photo/details.vue:439 @@ -2002,9 +2007,9 @@ msgid "Yellow" msgstr "" #: src/dialog/photo/archive.vue:15 -#: src/dialog/photo/files.vue:92 -#: src/dialog/photo/files.vue:98 -#: src/dialog/photo/files.vue:134 +#: src/dialog/photo/files.vue:101 +#: src/dialog/photo/files.vue:107 +#: src/dialog/photo/files.vue:143 #: src/dialog/photo/info.vue:191 #: src/dialog/photo/info.vue:218 #: src/dialog/photo/info.vue:245 diff --git a/frontend/src/model/file.js b/frontend/src/model/file.js index 2774415fc..979201d35 100644 --- a/frontend/src/model/file.js +++ b/frontend/src/model/file.js @@ -38,9 +38,9 @@ import {$gettext} from "common/vm"; export class File extends RestModel { getDefaults() { return { - InstanceID: "", UID: "", PhotoUID: "", + InstanceID: "", Root: "/", Name: "", OriginalName: "", diff --git a/frontend/src/model/photo.js b/frontend/src/model/photo.js index a639b211a..08332902e 100644 --- a/frontend/src/model/photo.js +++ b/frontend/src/model/photo.js @@ -49,8 +49,8 @@ export const DayUnknown = -1; export class Photo extends RestModel { getDefaults() { return { - DocumentID: "", UID: "", + DocumentID: "", Type: TypeImage, TypeSrc: "", Favorite: false, diff --git a/internal/entity/file.go b/internal/entity/file.go index bce641fdc..027d905df 100644 --- a/internal/entity/file.go +++ b/internal/entity/file.go @@ -17,10 +17,10 @@ type Files []File // File represents an image or sidecar file that belongs to a photo. type File struct { ID uint `gorm:"primary_key" json:"-" yaml:"-"` - UUID string `gorm:"type:varbinary(42);index;" json:"InstanceID,omitempty" yaml:"InstanceID,omitempty"` Photo *Photo `json:"-" yaml:"-"` PhotoID uint `gorm:"index;" json:"-" yaml:"-"` PhotoUID string `gorm:"type:varbinary(42);index;" json:"PhotoUID" yaml:"PhotoUID"` + InstanceID string `gorm:"type:varbinary(42);index;" json:"InstanceID,omitempty" yaml:"InstanceID,omitempty"` FileUID string `gorm:"type:varbinary(42);unique_index;" json:"UID" yaml:"UID"` FileName string `gorm:"type:varbinary(768);unique_index:idx_files_name_root;" json:"Name" yaml:"Name"` FileRoot string `gorm:"type:varbinary(16);default:'/';unique_index:idx_files_name_root;" json:"Root" yaml:"Root,omitempty"` diff --git a/internal/photoprism/index_mediafile.go b/internal/photoprism/index_mediafile.go index dc47f503c..062327c32 100644 --- a/internal/photoprism/index_mediafile.go +++ b/internal/photoprism/index_mediafile.go @@ -131,11 +131,6 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( result.Status = IndexDuplicate return result } - - if !fileExists && m.MetaData().HasInstanceID() { - fileQuery = entity.UnscopedDb().First(&file, "uuid = ?", m.MetaData().InstanceID) - fileExists = fileQuery.Error == nil - } } if !fileExists { @@ -255,7 +250,14 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( } if metaData := m.MetaData(); metaData.Error == nil { + file.FileCodec = metaData.Codec file.FileProjection = metaData.Projection + + if metaData.HasInstanceID() { + log.Infof("index: %s has instance_id %s", logName, txt.Quote(metaData.InstanceID)) + + file.InstanceID = metaData.InstanceID + } } case m.IsXMP(): // TODO: Proof-of-concept for indexing XMP sidecar files @@ -309,15 +311,15 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( } if metaData.HasDocumentID() && photo.UUID == "" { - log.Debugf("index: %s has document id %s", logName, txt.Quote(metaData.DocumentID)) + log.Infof("index: %s has document_id %s", logName, txt.Quote(metaData.DocumentID)) photo.UUID = metaData.DocumentID } - if metaData.HasInstanceID() && file.UUID == "" { - log.Debugf("index: %s has instance id %s", logName, txt.Quote(metaData.InstanceID)) + if metaData.HasInstanceID() { + log.Infof("index: %s has instance_id %s", logName, txt.Quote(metaData.InstanceID)) - file.UUID = metaData.InstanceID + file.InstanceID = metaData.InstanceID } file.FileCodec = metaData.Codec @@ -398,15 +400,15 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( } if metaData.HasDocumentID() && photo.UUID == "" { - log.Debugf("index: %s has document id %s", logName, txt.Quote(metaData.DocumentID)) + log.Infof("index: %s has document_id %s", logName, txt.Quote(metaData.DocumentID)) photo.UUID = metaData.DocumentID } - if metaData.HasInstanceID() && file.UUID == "" { - log.Debugf("index: %s has instance id %s", logName, txt.Quote(metaData.InstanceID)) + if metaData.HasInstanceID() { + log.Infof("index: %s has instance_id %s", logName, txt.Quote(metaData.InstanceID)) - file.UUID = metaData.InstanceID + file.InstanceID = metaData.InstanceID } file.FileCodec = metaData.Codec @@ -496,16 +498,10 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( } if metaData.HasDocumentID() && photo.UUID == "" { - log.Debugf("index: %s has document id %s", logName, txt.Quote(metaData.DocumentID)) + log.Debugf("index: %s has document_id %s", logName, txt.Quote(metaData.DocumentID)) photo.UUID = metaData.DocumentID } - - if metaData.HasInstanceID() && file.UUID == "" { - log.Debugf("index: %s has instance id %s", logName, txt.Quote(metaData.InstanceID)) - - file.UUID = metaData.InstanceID - } } if photo.CameraSrc == entity.SrcAuto { @@ -626,11 +622,11 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( w := txt.Keywords(details.Keywords) if !fs.IsGenerated(fileBase) { - w = append(w, txt.FilenameKeywords(filePath)...) w = append(w, txt.FilenameKeywords(fileBase)...) } w = append(w, locKeywords...) + w = append(w, txt.FilenameKeywords(filePath)...) w = append(w, txt.FilenameKeywords(file.OriginalName)...) w = append(w, file.FileMainColor) w = append(w, labels.Keywords()...) diff --git a/internal/query/photo_results.go b/internal/query/photo_results.go index 8dc08e897..2d81b2244 100644 --- a/internal/query/photo_results.go +++ b/internal/query/photo_results.go @@ -60,6 +60,7 @@ type PhotoResult struct { PlaceCity string `json:"PlaceCity"` PlaceState string `json:"PlaceState"` PlaceCountry string `json:"PlaceCountry"` + InstanceID string `json:"InstanceID"` FileID uint `json:"-"` // File FileUID string `json:"FileUID"` FileRoot string `json:"FileRoot"` diff --git a/internal/query/photo_search.go b/internal/query/photo_search.go index bd9f5de81..1b0e35722 100644 --- a/internal/query/photo_search.go +++ b/internal/query/photo_search.go @@ -26,7 +26,7 @@ func PhotoSearch(f form.PhotoSearch) (results PhotoResults, count int, err error // Main search query, avoids (slow) left joins. s = s.Table("photos"). Select(`photos.*, - files.id AS file_id, files.file_uid, files.file_primary, files.file_missing, files.file_name, + files.id AS file_id, files.file_uid, files.instance_id, files.file_primary, files.file_missing, files.file_name, files.file_root, files.file_hash, files.file_codec, files.file_type, files.file_mime, files.file_width, files.file_height, files.file_aspect_ratio, files.file_orientation, files.file_main_color, files.file_colors, files.file_luminance, files.file_chroma, files.file_projection, diff --git a/pkg/fs/base_test.go b/pkg/fs/base_test.go index b4bc68fbd..7359b5a02 100644 --- a/pkg/fs/base_test.go +++ b/pkg/fs/base_test.go @@ -126,6 +126,10 @@ func TestBase(t *testing.T) { result := BasePrefix("20180506_091537_DSC02122(-2.7).JPG", true) assert.Equal(t, "20180506_091537_DSC02122", result) }) + t.Run("1996 001.jpg", func(t *testing.T) { + result := BasePrefix("1996 001.jpg", true) + assert.Equal(t, "1996 001", result) + }) } func TestRelBase(t *testing.T) {