Skip to content

fix: keep latest videos on top of recording list#23

Merged
jrafaaael merged 7 commits intomasterfrom
fix/sort-descending
Mar 27, 2024
Merged

fix: keep latest videos on top of recording list#23
jrafaaael merged 7 commits intomasterfrom
fix/sort-descending

Conversation

@jrafaaael
Copy link
Owner

@jrafaaael jrafaaael commented Mar 27, 2024

fixes #13

Previously, recordings that were drag-n-drop'd in Videmo were saved with their original filename (can be alphanumeric). However, when users record directly from browser, their filename is the recording date in UTC (is a number). This is a problem because OPFS sort files alphabetically, so:

  1. some recordings that were drag-n-drop'd are listed at top of recording list, even if the last user video was recorded directly from Chrome.
  2. some recordings that were drag-n-drop'd are listed at bottom of recording list, even if this was the latest video in Videmo.

In this PR, I rename folders with original filename from drag-n-drop'd recordings and save it with the current date in UTC as filename (same as videos recorded directly from browser) to keep compatibility with the old behavior.
However, this create a new problem: users will search their recordings with original name because those recordings were saved with this behavior. To solve this, in their associated object value in localStorage, I create a new key called name to save the original name. This allows me to develop some new features:

  1. rename recordings
  2. sort recordings alphabetically and by date

@vercel
Copy link

vercel bot commented Mar 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
videmo ✅ Ready (Inspect) Visit Preview Mar 27, 2024 4:11am

@jrafaaael jrafaaael merged commit 1f86e40 into master Mar 27, 2024
@jrafaaael jrafaaael deleted the fix/sort-descending branch March 27, 2024 19:41
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

Successfully merging this pull request may close these issues.

[BUG]: recordings aren't displayed in chronological order

1 participant