timeline: allow disabling RAW stack
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/900/head
parent
317874ea44
commit
e04fc9e091
|
@ -102,6 +102,7 @@ class OtherController extends GenericApiController
|
||||||
// general settings
|
// general settings
|
||||||
'timeline_path' => $getAppConfig('timelinePath', SystemConfig::get('memories.timeline.default_path')),
|
'timeline_path' => $getAppConfig('timelinePath', SystemConfig::get('memories.timeline.default_path')),
|
||||||
'enable_top_memories' => 'true' === $getAppConfig('enableTopMemories', 'true'),
|
'enable_top_memories' => 'true' === $getAppConfig('enableTopMemories', 'true'),
|
||||||
|
'stack_raw_files' => 'true' === $getAppConfig('stackRawFiles', 'true'),
|
||||||
|
|
||||||
// viewer settings
|
// viewer settings
|
||||||
'high_res_cond_default' => SystemConfig::get('memories.viewer.high_res_cond_default'),
|
'high_res_cond_default' => SystemConfig::get('memories.viewer.high_res_cond_default'),
|
||||||
|
|
|
@ -44,6 +44,14 @@
|
||||||
>
|
>
|
||||||
{{ t('memories', 'Show past photos on top of timeline') }}
|
{{ t('memories', 'Show past photos on top of timeline') }}
|
||||||
</NcCheckboxRadioSwitch>
|
</NcCheckboxRadioSwitch>
|
||||||
|
|
||||||
|
<NcCheckboxRadioSwitch
|
||||||
|
:checked.sync="config.stack_raw_files"
|
||||||
|
@update:checked="updateStackRawFiles"
|
||||||
|
type="switch"
|
||||||
|
>
|
||||||
|
{{ t('memories', 'Stack RAW files with same name') }}
|
||||||
|
</NcCheckboxRadioSwitch>
|
||||||
</NcAppSettingsSection>
|
</NcAppSettingsSection>
|
||||||
|
|
||||||
<NcAppSettingsSection id="viewer-settings" :title="t('memories', 'Photo Viewer')">
|
<NcAppSettingsSection id="viewer-settings" :title="t('memories', 'Photo Viewer')">
|
||||||
|
@ -286,6 +294,10 @@ export default defineComponent({
|
||||||
await this.updateSetting('enable_top_memories', 'enableTopMemories');
|
await this.updateSetting('enable_top_memories', 'enableTopMemories');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async updateStackRawFiles() {
|
||||||
|
await this.updateSetting('stack_raw_files', 'stackRawFiles');
|
||||||
|
},
|
||||||
|
|
||||||
// Viewer settings
|
// Viewer settings
|
||||||
async updateHighResCond(val: IConfig['high_res_cond']) {
|
async updateHighResCond(val: IConfig['high_res_cond']) {
|
||||||
this.config.high_res_cond = val;
|
this.config.high_res_cond = val;
|
||||||
|
|
|
@ -1044,7 +1044,7 @@ export default defineComponent({
|
||||||
if (!basename) continue; // huh?
|
if (!basename) continue; // huh?
|
||||||
|
|
||||||
// Skip for raw files
|
// Skip for raw files
|
||||||
if (photo.mimetype === this.c.MIME_RAW) {
|
if (this.config.stack_raw_files && photo.mimetype === this.c.MIME_RAW) {
|
||||||
need2 = true;
|
need2 = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1065,7 +1065,7 @@ export default defineComponent({
|
||||||
const res2: IPhoto[] = [];
|
const res2: IPhoto[] = [];
|
||||||
for (const photo of res1) {
|
for (const photo of res1) {
|
||||||
// Remove RAW files if they can be stacked
|
// Remove RAW files if they can be stacked
|
||||||
if (photo.mimetype === this.c.MIME_RAW) {
|
if (this.config.stack_raw_files && photo.mimetype === this.c.MIME_RAW) {
|
||||||
// Get first matching non-raw file
|
// Get first matching non-raw file
|
||||||
const basename = utils.removeExtension(photo.basename ?? String());
|
const basename = utils.removeExtension(photo.basename ?? String());
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ class StaticConfig {
|
||||||
// general settings
|
// general settings
|
||||||
timeline_path: '_unknown_',
|
timeline_path: '_unknown_',
|
||||||
enable_top_memories: true,
|
enable_top_memories: true,
|
||||||
|
stack_raw_files: true,
|
||||||
|
|
||||||
// viewer settings
|
// viewer settings
|
||||||
high_res_cond_default: 'zoom',
|
high_res_cond_default: 'zoom',
|
||||||
|
|
|
@ -18,6 +18,7 @@ declare module '@typings' {
|
||||||
// general settings
|
// general settings
|
||||||
timeline_path: string;
|
timeline_path: string;
|
||||||
enable_top_memories: boolean;
|
enable_top_memories: boolean;
|
||||||
|
stack_raw_files: boolean;
|
||||||
|
|
||||||
// viewer settings
|
// viewer settings
|
||||||
high_res_cond_default: 'always' | 'zoom' | 'never';
|
high_res_cond_default: 'always' | 'zoom' | 'never';
|
||||||
|
|
Loading…
Reference in New Issue