Skip to content

Commit

Permalink
added explanation for a seemingly magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelkomarov authored Aug 30, 2024
1 parent cc02a0d commit af50843
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exportify.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ let PlaylistExporter = {
while (zip.file(fileName + ".csv")) { fileName += "_" } // Add underscores if the file already exists so playlists with duplicate names don't overwrite each other.
zip.file(fileName + ".csv", csv)
} catch (e) { // Surface all errors
error.innerHTML = error.innerHTML.slice(0, -120) + "Couldn't export " + playlist.name + " with id " +
// 117 is the length of the "Please ..." message at the end. Slice it off before adding on subsequent errors.
error.innerHTML = error.innerHTML.slice(0, -117) + "Couldn't export " + playlist.name + " with id " +
playlist.id + ". Encountered <tt>" + e + "</tt><br>" + e.stack +
'<br>Please <a href="https://github.com/pavelkomarov/exportify/issues">let us know</a>. ' +
"The others are still being zipped."
Expand Down

0 comments on commit af50843

Please sign in to comment.