Skip to content

Commit

Permalink
fix(encoding): fixed and rewrote playlist identification and linking …
Browse files Browse the repository at this point in the history
…to better support every chars

re #10
  • Loading branch information
will-moss committed Oct 28, 2024
1 parent e551e02 commit 8f32876
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ const App = () => {
.slice(0, -1)
.join(""),
extension: current.url.split(".").at(-1).toLowerCase(),
playlist: current.url.replace(encodeURIComponent(current.name), ""),
// playlist: current.url.replace(current.name, ""),
playlist: current.url.substr(0, current.url.lastIndexOf("/")),
metadataURL: false,
};

Expand All @@ -374,7 +375,8 @@ const App = () => {

// Filter video files retrieved according to the current url-defined playlist
let currentPlaylist = window._decodeURIComponentSafe(window.location.pathname.substring(1));
if (currentPlaylist && currentPlaylist.substr(-1) !== "/") currentPlaylist += "/";
if (currentPlaylist && currentPlaylist.substr(-1) === "/")
currentPlaylist = currentPlaylist.substring(0, currentPlaylist.length - 1);
_videoFiles = _videoFiles.filter((v) => v.playlist === currentPlaylist);

setVideos((freshVideos) => {
Expand Down

0 comments on commit 8f32876

Please sign in to comment.