timeline: allow disabling RAW stack

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/900/head
Varun Patil 2023-10-29 18:12:14 -07:00
parent 317874ea44
commit e04fc9e091
5 changed files with 17 additions and 2 deletions

View File

@ -102,6 +102,7 @@ class OtherController extends GenericApiController
// general settings
'timeline_path' => $getAppConfig('timelinePath', SystemConfig::get('memories.timeline.default_path')),
'enable_top_memories' => 'true' === $getAppConfig('enableTopMemories', 'true'),
'stack_raw_files' => 'true' === $getAppConfig('stackRawFiles', 'true'),
// viewer settings
'high_res_cond_default' => SystemConfig::get('memories.viewer.high_res_cond_default'),

View File

@ -44,6 +44,14 @@
>
{{ t('memories', 'Show past photos on top of timeline') }}
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch
:checked.sync="config.stack_raw_files"
@update:checked="updateStackRawFiles"
type="switch"
>
{{ t('memories', 'Stack RAW files with same name') }}
</NcCheckboxRadioSwitch>
</NcAppSettingsSection>
<NcAppSettingsSection id="viewer-settings" :title="t('memories', 'Photo Viewer')">
@ -286,6 +294,10 @@ export default defineComponent({
await this.updateSetting('enable_top_memories', 'enableTopMemories');
},
async updateStackRawFiles() {
await this.updateSetting('stack_raw_files', 'stackRawFiles');
},
// Viewer settings
async updateHighResCond(val: IConfig['high_res_cond']) {
this.config.high_res_cond = val;

View File

@ -1044,7 +1044,7 @@ export default defineComponent({
if (!basename) continue; // huh?
// 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;
continue;
}
@ -1065,7 +1065,7 @@ export default defineComponent({
const res2: IPhoto[] = [];
for (const photo of res1) {
// 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
const basename = utils.removeExtension(photo.basename ?? String());

View File

@ -121,6 +121,7 @@ class StaticConfig {
// general settings
timeline_path: '_unknown_',
enable_top_memories: true,
stack_raw_files: true,
// viewer settings
high_res_cond_default: 'zoom',

View File

@ -18,6 +18,7 @@ declare module '@typings' {
// general settings
timeline_path: string;
enable_top_memories: boolean;
stack_raw_files: boolean;
// viewer settings
high_res_cond_default: 'always' | 'zoom' | 'never';