Skip to content

filename contains . will be incorrectly matched #45

Description

@haowenwu

Root Cause: split(".").at(0) truncates filenames containing dots

In src/App.js, the retrieveVideos() function extracts a file ID like this:

const _id = current.name.split(".").at(0);

This takes only the portion before the first dot as the unique identifier. For a file like S01.E03.my.video.mp4, the _id becomes just S01 instead of
S01.E03.my.video.

Consequences:

  • Multiple files whose names share the same prefix before the first . get the same _id
  • Since videos are stored in an object (_videoFiles[_id] = ...), later files overwrite earlier ones — causing videos to "disappear"
  • Metadata JSON files also get incorrectly matched to the wrong video

The fix should be:

// Before (broken): only takes text before the FIRST dot
const _id = current.name.split(".").at(0);

// After (correct): removes only the last extension
const _id = current.name.split(".").slice(0, -1).join(".");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions