Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Editing default view settings for Guest user #3300

Open
Archinowsk opened this issue Jan 29, 2025 · 0 comments
Open

[Feature Request] Editing default view settings for Guest user #3300

Archinowsk opened this issue Jan 29, 2025 · 0 comments

Comments

@Archinowsk
Copy link

Archinowsk commented Jan 29, 2025

I'm using calibre-web to host a public roleplaying library page (roolipelikirjasto.fi). I would like to edit Guest user default view settings. Specifically, I would like the Series page to default into using List instead of Grid.

Seems the Guest user view_settings are only loaded from flask_session (ie cookie):

calibre-web/cps/ub.py

Lines 329 to 330 in efc7ce3

def get_view_property(self, page, prop):
if 'view' in flask_session:

view_settings from DB seem to also be available:

self.view_settings = data.view_settings

For Guest user, would it be possible to get view_settings using DB user.view_settings if flask_session is missing?

def get_view_property(self, page, prop):
    if 'view' in flask_session:
        if not flask_session['view'].get(page):
            return None
        return flask_session['view'][page].get(prop)
+   if self.view_settings.get(page):
+      return self.view_settings[page].get(prop)
    return None

In this case, I would be editing user.view_settings directly to DB. I understand this is somewhat niche feature request 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant