Merge branch 'rhyst-add-public-full-res-options'
commit
bc3572b571
|
@ -102,6 +102,7 @@ class OtherController extends GenericApiController
|
||||||
'enable_top_memories' => 'true' === $getAppConfig('enableTopMemories', 'true'),
|
'enable_top_memories' => 'true' === $getAppConfig('enableTopMemories', 'true'),
|
||||||
|
|
||||||
// viewer settings
|
// viewer settings
|
||||||
|
'high_res_cond_default' => Util::getSystemConfig('memories.viewer.high_res_cond_default'),
|
||||||
'livephoto_autoplay' => 'true' === $getAppConfig('livephotoAutoplay', 'true'),
|
'livephoto_autoplay' => 'true' === $getAppConfig('livephotoAutoplay', 'true'),
|
||||||
'sidebar_filepath' => 'true' === $getAppConfig('sidebarFilepath', false),
|
'sidebar_filepath' => 'true' === $getAppConfig('sidebarFilepath', false),
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,10 @@ return [
|
||||||
// Places database type identifier
|
// Places database type identifier
|
||||||
'memories.gis_type' => -1,
|
'memories.gis_type' => -1,
|
||||||
|
|
||||||
|
// Default viewer high resolution image loading condition
|
||||||
|
// Valid values: 'always' | 'zoom' | 'never'
|
||||||
|
'memories.viewer.high_res_cond_default' => 'zoom',
|
||||||
|
|
||||||
// Disable transcoding
|
// Disable transcoding
|
||||||
'memories.vod.disable' => true,
|
'memories.vod.disable' => true,
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</NcCheckboxRadioSwitch>
|
</NcCheckboxRadioSwitch>
|
||||||
</NcAppSettingsSection>
|
</NcAppSettingsSection>
|
||||||
|
|
||||||
<NcAppSettingsSection id="viewer-settings" :title="t('memories', 'Viewer')">
|
<NcAppSettingsSection id="viewer-settings" :title="t('memories', 'Photo Viewer')">
|
||||||
<NcCheckboxRadioSwitch
|
<NcCheckboxRadioSwitch
|
||||||
:checked.sync="config.livephoto_autoplay"
|
:checked.sync="config.livephoto_autoplay"
|
||||||
@update:checked="updateLivephotoAutoplay"
|
@update:checked="updateLivephotoAutoplay"
|
||||||
|
@ -55,22 +55,6 @@
|
||||||
{{ t('memories', 'Autoplay Live Photos') }}
|
{{ t('memories', 'Autoplay Live Photos') }}
|
||||||
</NcCheckboxRadioSwitch>
|
</NcCheckboxRadioSwitch>
|
||||||
|
|
||||||
<NcCheckboxRadioSwitch
|
|
||||||
:checked.sync="config.full_res_on_zoom"
|
|
||||||
@update:checked="updateFullResOnZoom"
|
|
||||||
type="switch"
|
|
||||||
>
|
|
||||||
{{ t('memories', 'Load full size image on zoom') }}
|
|
||||||
</NcCheckboxRadioSwitch>
|
|
||||||
|
|
||||||
<NcCheckboxRadioSwitch
|
|
||||||
:checked.sync="config.full_res_always"
|
|
||||||
@update:checked="updateFullResAlways"
|
|
||||||
type="switch"
|
|
||||||
>
|
|
||||||
{{ t('memories', 'Always load full size image (not recommended)') }}
|
|
||||||
</NcCheckboxRadioSwitch>
|
|
||||||
|
|
||||||
<NcCheckboxRadioSwitch
|
<NcCheckboxRadioSwitch
|
||||||
:checked.sync="config.sidebar_filepath"
|
:checked.sync="config.sidebar_filepath"
|
||||||
@update:checked="updateSidebarFilepath"
|
@update:checked="updateSidebarFilepath"
|
||||||
|
@ -78,6 +62,34 @@
|
||||||
>
|
>
|
||||||
{{ t('memories', 'Show full file path in sidebar') }}
|
{{ t('memories', 'Show full file path in sidebar') }}
|
||||||
</NcCheckboxRadioSwitch>
|
</NcCheckboxRadioSwitch>
|
||||||
|
|
||||||
|
<div class="radio-group">
|
||||||
|
<div class="title">{{ t('memories', 'High resolution image loading behavior') }}</div>
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked="highResCond"
|
||||||
|
value="zoom"
|
||||||
|
name="vhrc_radio"
|
||||||
|
type="radio"
|
||||||
|
@update:checked="updateHighResCond($event)"
|
||||||
|
>{{ t('memories', 'Load high resolution image on zoom') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked="highResCond"
|
||||||
|
value="always"
|
||||||
|
name="vhrc_radio"
|
||||||
|
type="radio"
|
||||||
|
@update:checked="updateHighResCond($event)"
|
||||||
|
>{{ t('memories', 'Always load high resolution image (not recommended)') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked="highResCond"
|
||||||
|
value="never"
|
||||||
|
name="vhrc_radio"
|
||||||
|
type="radio"
|
||||||
|
@update:checked="updateHighResCond($event)"
|
||||||
|
>{{ t('memories', 'Never load high resolution image') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
|
</div>
|
||||||
</NcAppSettingsSection>
|
</NcAppSettingsSection>
|
||||||
|
|
||||||
<NcAppSettingsSection id="account-settings" :title="t('memories', 'Account')" v-if="isNative">
|
<NcAppSettingsSection id="account-settings" :title="t('memories', 'Account')" v-if="isNative">
|
||||||
|
@ -156,6 +168,8 @@ const NcCheckboxRadioSwitch = () => import('@nextcloud/vue/dist/Components/NcChe
|
||||||
|
|
||||||
import MultiPathSelectionModal from './modal/MultiPathSelectionModal.vue';
|
import MultiPathSelectionModal from './modal/MultiPathSelectionModal.vue';
|
||||||
|
|
||||||
|
import type { IConfig } from '../types';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
|
|
||||||
|
@ -192,6 +206,10 @@ export default defineComponent({
|
||||||
user(): string {
|
user(): string {
|
||||||
return utils.uid ?? String();
|
return utils.uid ?? String();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
highResCond(): IConfig['high_res_cond_default'] {
|
||||||
|
return this.config.high_res_cond || this.config.high_res_cond_default || 'zoom';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -242,12 +260,9 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
// Viewer settings
|
// Viewer settings
|
||||||
async updateFullResOnZoom() {
|
async updateHighResCond(val: IConfig['high_res_cond']) {
|
||||||
await this.updateSetting('full_res_on_zoom');
|
this.config.high_res_cond = val;
|
||||||
},
|
await this.updateSetting('high_res_cond');
|
||||||
|
|
||||||
async updateFullResAlways() {
|
|
||||||
await this.updateSetting('full_res_always');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async updateLivephotoAutoplay() {
|
async updateLivephotoAutoplay() {
|
||||||
|
@ -312,5 +327,21 @@ export default defineComponent({
|
||||||
#sign-out {
|
#sign-out {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.checkbox-radio-switch__label {
|
||||||
|
padding: 1px 14px; // was 4px 14px, make it more compact
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-group {
|
||||||
|
margin-top: 6px;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox-radio-switch-radio {
|
||||||
|
margin: 2px 16px; // indent for radio button
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -34,6 +34,7 @@ import Help from './sections/Help.vue';
|
||||||
import Exif from './sections/Exif.vue';
|
import Exif from './sections/Exif.vue';
|
||||||
import Indexing from './sections/Indexing.vue';
|
import Indexing from './sections/Indexing.vue';
|
||||||
import FileSupport from './sections/FileSupport.vue';
|
import FileSupport from './sections/FileSupport.vue';
|
||||||
|
import Viewer from './sections/ViewerAdmin.vue';
|
||||||
import Performance from './sections/Performance.vue';
|
import Performance from './sections/Performance.vue';
|
||||||
import Apps from './sections/Apps.vue';
|
import Apps from './sections/Apps.vue';
|
||||||
import Places from './sections/Places.vue';
|
import Places from './sections/Places.vue';
|
||||||
|
@ -54,7 +55,19 @@ export default defineComponent({
|
||||||
config: null as ISystemConfig | null,
|
config: null as ISystemConfig | null,
|
||||||
sconfig: null as IConfig | null,
|
sconfig: null as IConfig | null,
|
||||||
|
|
||||||
components: [Help, Exif, Indexing, FileSupport, Performance, Apps, Places, Video, VideoTranscoder, VideoAccel],
|
components: [
|
||||||
|
Help,
|
||||||
|
Exif,
|
||||||
|
Indexing,
|
||||||
|
FileSupport,
|
||||||
|
Viewer,
|
||||||
|
Performance,
|
||||||
|
Apps,
|
||||||
|
Places,
|
||||||
|
Video,
|
||||||
|
VideoTranscoder,
|
||||||
|
VideoAccel,
|
||||||
|
],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import type { IConfig } from '../../types';
|
||||||
|
|
||||||
/** System configuration */
|
/** System configuration */
|
||||||
export type ISystemConfig = {
|
export type ISystemConfig = {
|
||||||
'memories.exiftool': string;
|
'memories.exiftool': string;
|
||||||
|
@ -7,6 +9,8 @@ export type ISystemConfig = {
|
||||||
|
|
||||||
'memories.gis_type': number;
|
'memories.gis_type': number;
|
||||||
|
|
||||||
|
'memories.viewer.high_res_cond_default': IConfig['high_res_cond_default'];
|
||||||
|
|
||||||
'memories.vod.disable': boolean;
|
'memories.vod.disable': boolean;
|
||||||
'memories.vod.ffmpeg': string;
|
'memories.vod.ffmpeg': string;
|
||||||
'memories.vod.ffprobe': string;
|
'memories.vod.ffprobe': string;
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<template>
|
||||||
|
<div class="admin-section">
|
||||||
|
<h2>{{ $options.title }}</h2>
|
||||||
|
|
||||||
|
{{ t('memories', 'Default high resolution image loading behavior of the photo viewer.') }}
|
||||||
|
{{ t('memories', 'The configuration here also applies to public link shares.') }}
|
||||||
|
{{ t('memories', 'Users may override this setting.') }}
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked.sync="config['memories.viewer.high_res_cond_default']"
|
||||||
|
value="zoom"
|
||||||
|
name="vhrc_radio"
|
||||||
|
type="radio"
|
||||||
|
@update:checked="update('memories.viewer.high_res_cond_default')"
|
||||||
|
>{{ t('memories', 'Load high resolution image on zoom') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked.sync="config['memories.viewer.high_res_cond_default']"
|
||||||
|
value="always"
|
||||||
|
name="vhrc_radio"
|
||||||
|
type="radio"
|
||||||
|
@update:checked="update('memories.viewer.high_res_cond_default')"
|
||||||
|
>{{ t('memories', 'Always load high resolution image (not recommended if using HEIC/TIFF)') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked.sync="config['memories.viewer.high_res_cond_default']"
|
||||||
|
value="never"
|
||||||
|
name="vhrc_radio"
|
||||||
|
type="radio"
|
||||||
|
@update:checked="update('memories.viewer.high_res_cond_default')"
|
||||||
|
>{{ t('memories', 'Never load high resolution image') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
import { translate as t } from '@nextcloud/l10n';
|
||||||
|
|
||||||
|
import AdminMixin from '../AdminMixin';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'Viewer',
|
||||||
|
title: t('memories', 'Photo Viewer'),
|
||||||
|
mixins: [AdminMixin],
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -808,7 +808,7 @@ export default defineComponent({
|
||||||
: utils.isLocalPhoto(photo)
|
: utils.isLocalPhoto(photo)
|
||||||
? nativex.API.IMAGE_FULL(photo.fileid)
|
? nativex.API.IMAGE_FULL(photo.fileid)
|
||||||
: API.IMAGE_DECODABLE(photo.fileid, photo.etag);
|
: API.IMAGE_DECODABLE(photo.fileid, photo.etag);
|
||||||
const fullLoadCond = this.config.full_res_always ? 'always' : this.config.full_res_on_zoom ? 'zoom' : 'never';
|
const fullLoadCond = this.config.high_res_cond || this.config.high_res_cond_default || 'zoom';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
src: previewUrl,
|
src: previewUrl,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Content from 'photoswipe/dist/types/slide/content';
|
import Content from 'photoswipe/dist/types/slide/content';
|
||||||
import Slide, { _SlideData } from 'photoswipe/dist/types/slide/slide';
|
import Slide, { _SlideData } from 'photoswipe/dist/types/slide/slide';
|
||||||
import { IPhoto } from '../../types';
|
import type { IPhoto, IConfig } from '../../types';
|
||||||
|
|
||||||
type PsAugment = {
|
type PsAugment = {
|
||||||
data: _SlideData & {
|
data: _SlideData & {
|
||||||
|
@ -11,7 +11,7 @@ type PsAugment = {
|
||||||
/** The source of the high resolution image. */
|
/** The source of the high resolution image. */
|
||||||
highSrc: string | null;
|
highSrc: string | null;
|
||||||
/** The condition for loading the high resolution image. */
|
/** The condition for loading the high resolution image. */
|
||||||
highSrcCond: 'always' | 'zoom' | 'never';
|
highSrcCond: IConfig['high_res_cond'];
|
||||||
/** The type of content. */
|
/** The type of content. */
|
||||||
type: 'image' | 'video';
|
type: 'image' | 'video';
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,19 +10,13 @@ import staticConfig from '../services/static-config';
|
||||||
|
|
||||||
const eventName: keyof utils.BusEvent = 'memories:user-config-changed';
|
const eventName: keyof utils.BusEvent = 'memories:user-config-changed';
|
||||||
|
|
||||||
const localSettings: (keyof IConfig)[] = [
|
const localSettings: (keyof IConfig)[] = ['square_thumbs', 'high_res_cond', 'show_face_rect', 'album_list_sort'];
|
||||||
'square_thumbs',
|
|
||||||
'full_res_on_zoom',
|
|
||||||
'full_res_always',
|
|
||||||
'show_face_rect',
|
|
||||||
'album_list_sort',
|
|
||||||
];
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'UserConfig',
|
name: 'UserConfig',
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
config: { ...staticConfig.getDefault() },
|
config: { ...staticConfig.getDefault() } as IConfig,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
@ -44,9 +38,9 @@ export default defineComponent({
|
||||||
utils.bus.emit(eventName, null);
|
utils.bus.emit(eventName, null);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateLocalSetting({ setting, value }) {
|
updateLocalSetting(val: { setting: keyof IConfig; value: IConfig[keyof IConfig] }) {
|
||||||
if (setting) {
|
if (val?.setting) {
|
||||||
this.config[setting] = value;
|
(this.config as any)[val.setting] = val.value;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -55,7 +49,7 @@ export default defineComponent({
|
||||||
|
|
||||||
if (!localSettings.includes(setting)) {
|
if (!localSettings.includes(setting)) {
|
||||||
await axios.put(API.CONFIG(remote ?? setting), {
|
await axios.put(API.CONFIG(remote ?? setting), {
|
||||||
value: value.toString(),
|
value: value?.toString() ?? '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,11 @@ class StaticConfig {
|
||||||
this.config[key] = value;
|
this.config[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
this.storage.removeItem(`memories_${key}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.storage.setItem(`memories_${key}`, value.toString());
|
this.storage.setItem(`memories_${key}`, value.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,6 +122,7 @@ class StaticConfig {
|
||||||
enable_top_memories: true,
|
enable_top_memories: true,
|
||||||
|
|
||||||
// viewer settings
|
// viewer settings
|
||||||
|
high_res_cond_default: 'zoom',
|
||||||
livephoto_autoplay: true,
|
livephoto_autoplay: true,
|
||||||
sidebar_filepath: false,
|
sidebar_filepath: false,
|
||||||
|
|
||||||
|
@ -130,8 +136,7 @@ class StaticConfig {
|
||||||
|
|
||||||
// local settings
|
// local settings
|
||||||
square_thumbs: false,
|
square_thumbs: false,
|
||||||
full_res_on_zoom: true,
|
high_res_cond: null,
|
||||||
full_res_always: false,
|
|
||||||
show_face_rect: false,
|
show_face_rect: false,
|
||||||
album_list_sort: 1,
|
album_list_sort: 1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -275,6 +275,7 @@ export type IConfig = {
|
||||||
enable_top_memories: boolean;
|
enable_top_memories: boolean;
|
||||||
|
|
||||||
// viewer settings
|
// viewer settings
|
||||||
|
high_res_cond_default: 'always' | 'zoom' | 'never';
|
||||||
livephoto_autoplay: boolean;
|
livephoto_autoplay: boolean;
|
||||||
sidebar_filepath: boolean;
|
sidebar_filepath: boolean;
|
||||||
|
|
||||||
|
@ -288,8 +289,7 @@ export type IConfig = {
|
||||||
|
|
||||||
// local settings
|
// local settings
|
||||||
square_thumbs: boolean;
|
square_thumbs: boolean;
|
||||||
full_res_on_zoom: boolean;
|
high_res_cond: IConfig['high_res_cond_default'] | null;
|
||||||
full_res_always: boolean;
|
|
||||||
show_face_rect: boolean;
|
show_face_rect: boolean;
|
||||||
album_list_sort: 1 | 2;
|
album_list_sort: 1 | 2;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue