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

[Refactor] Align extension checks #148

Open
fenekku opened this issue Jul 27, 2021 · 0 comments
Open

[Refactor] Align extension checks #148

fenekku opened this issue Jul 27, 2021 · 0 comments

Comments

@fenekku
Copy link
Contributor

fenekku commented Jul 27, 2021

To determine "previewability" 2 approaches are taken relying on 2 different formats for file extensions

  1. .txt, .zip, .png ...
  2. txt, zip, png, ...

Before showing previews

has_previewable_files calls

    is_previewable(ext) calls

        current_previewer.previewable_extensions

            loads previewable_extensions from each plugin 

This checks extensions in this format txt, md, zip...

When actually previewing

preview calls

    plugin.can_preview calls

        file is a PreviewFile instance

        file.has_extensions(
            *[f".{ext}" for ext in previewable_extensions]
        )

checks extensions in this format .txt, .md, .zip...

This minute difference can easily breakdown the preview and requires more maintenance.

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