Skip to content

hash the file contents, not the pathname #6

Open
@calestyo

Description

I personally probably don't need this, but just as an idea:

Hashing the pathname has a number of disadvantages, well mostly one,... what if the file (or an of its parent dirs) is moved?

  1. What I've described in chapters files as sidecars mpv-player/mpv#11248, namely hashing the file’s contents. Just with some minor change, namely not hashing the full file, but perhaps only the first 1MB or so.... or perhaps better somewhere in the middle of the file. Of course this won’t work with streamed file.
  2. Another idea would be to attach XATTRs to the file and use UUIDs. But again, wouldn't work on streamed data, and sometimes XATTRs may get "lost".

Maybe one could just keep hashing the pathname for any paths that don't start with / or file:

Activity

mar04

mar04 commented on Feb 1, 2023

@mar04
Owner

I followed what mpv does with it's 'watch later' feature - that is hashing paths. Other options have their pros but also cons, as you mentioned, we would have to deal with special cases and I'm not sure it's worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      hash the file contents, not the pathname · Issue #6 · mar04/chapters_for_mpv