diff --git a/frontend/src/component/photo/list.vue b/frontend/src/component/photo/list.vue index 4b44bd7bf..6d918d904 100644 --- a/frontend/src/component/photo/list.vue +++ b/frontend/src/component/photo/list.vue @@ -52,7 +52,7 @@ flat icon large absolute class="p-photo-select"> check_circle - diff --git a/frontend/src/model/photo.js b/frontend/src/model/photo.js index bac8ddd14..50b77b014 100644 --- a/frontend/src/model/photo.js +++ b/frontend/src/model/photo.js @@ -39,9 +39,13 @@ import {$gettext} from "common/vm"; export const SrcManual = "manual"; export const CodecAvc1 = "avc1"; -export const TypeMP4 = "mp4"; -export const TypeJpeg = "jpg"; +export const FormatMp4 = "mp4"; +export const FormatAvc = "avc"; +export const FormatJpeg = "jpg"; export const TypeImage = "image"; +export const TypeVideo= "video"; +export const TypeLive = "live"; +export const TypeRaw = "raw"; export const YearUnknown = -1; export const MonthUnknown = -1; export const DayUnknown = -1; @@ -260,7 +264,7 @@ export class Photo extends RestModel { let file = this.Files.find(f => f.Codec === CodecAvc1); if (!file) { - file = this.Files.find(f => f.Type === TypeMP4); + file = this.Files.find(f => f.Type === FormatMp4); } if (!file) { @@ -274,10 +278,10 @@ export class Photo extends RestModel { const file = this.videoFile(); if (file) { - return `/api/v1/videos/${file.Hash}/${config.previewToken()}/${TypeMP4}`; + return `/api/v1/videos/${file.Hash}/${config.previewToken()}/${FormatAvc}`; } - return `/api/v1/videos/${this.Hash}/${config.previewToken()}/${TypeMP4}`; + return `/api/v1/videos/${this.Hash}/${config.previewToken()}/${FormatAvc}`; } mainFile() { @@ -288,7 +292,7 @@ export class Photo extends RestModel { let file = this.Files.find(f => !!f.Primary); if (!file) { - file = this.Files.find(f => f.Type === TypeJpeg); + file = this.Files.find(f => f.Type === FormatJpeg); } return file; diff --git a/frontend/src/options/options.js b/frontend/src/options/options.js index 469dbec7e..01dc0f8aa 100644 --- a/frontend/src/options/options.js +++ b/frontend/src/options/options.js @@ -2,6 +2,7 @@ import {$gettext} from "common/vm"; import moment from "moment-timezone"; import {Info} from "luxon"; import {config} from "../session"; +import {TypeVideo,TypeImage,TypeLive,TypeRaw} from "../model/photo"; export const TimeZones = () => moment.tz.names(); @@ -189,19 +190,19 @@ export const MapsStyle = () => [ export const PhotoTypes = () => [ { "text": $gettext("Image"), - "value": "image", + "value": TypeImage, }, { "text": $gettext("Raw"), - "value": "raw", + "value": TypeRaw, }, { "text": $gettext("Live"), - "value": "live", + "value": TypeLive, }, { "text": $gettext("Video"), - "value": "video", + "value": TypeVideo, }, ]; diff --git a/frontend/src/pages/album/photos.vue b/frontend/src/pages/album/photos.vue index 0159ca4fb..6f57dd074 100644 --- a/frontend/src/pages/album/photos.vue +++ b/frontend/src/pages/album/photos.vue @@ -46,7 +46,7 @@