Skip to content

Commit adee548

Browse files
committed
fix: avoid server redirection when fetching backgrounds directory (#84)
1 parent d37bb95 commit adee548

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const URL_ORIGIN = location.origin + location.pathname,
4848
VERSION = packageJson.version;
4949

5050
const AUTOHIDE_DELAY = 500, // delay for triggering front panel auto-collapse (in milliseconds)
51-
BG_DIRECTORY = 'backgrounds', // server folder name for built-in backgrounds
51+
BG_DIRECTORY = 'backgrounds/', // server folder name for built-in backgrounds (must end with a slash!)
5252
MAX_METADATA_REQUESTS = 4, // max concurrent metadata requests
5353
MAX_QUEUED_SONGS = 2000,
5454
NEXT_TRACK = -1; // for loadSong()
@@ -3250,9 +3250,9 @@ async function retrieveBackgrounds() {
32503250
for ( const { url, file } of fileExplorer.parseWebIndex( content ) ) {
32513251
const name = parsePath( file ).baseName;
32523252
if ( imageExtensions.test( file ) )
3253-
bgImages.push( { name, url: BG_DIRECTORY + '/' + url } );
3253+
bgImages.push( { name, url: BG_DIRECTORY + url } );
32543254
else if ( videoExtensions.test( file ) )
3255-
bgVideos.push( { name, url: BG_DIRECTORY + '/' + url } );
3255+
bgVideos.push( { name, url: BG_DIRECTORY + url } );
32563256
}
32573257
}
32583258
catch( e ) {} // fail silently (possibly directory not found on server)

0 commit comments

Comments
 (0)