Skip to content

Commit

Permalink
Remove some convertAsciiToUtf8() #272
Browse files Browse the repository at this point in the history
  • Loading branch information
tueddy committed Dec 4, 2023
1 parent 29bf165 commit 3e11c45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## DEV-branch

* 04.12.2023: Remove some convertAsciiToUtf8() #272
* 30.11.2023: Fix a nullptr access after trying to replay an invalid filename (#271), thanks to Olaf!
* 29.11.2023: Updated audio library to play more MP3s, faster track change & delivery of the cover image
* 25.11.2023: Save some cpu time in audio task by only updating the playtime statistics every 250ms
Expand Down
4 changes: 1 addition & 3 deletions src/AudioPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,10 @@ uint32_t AudioPlayer_GetFileDuration(void) {
}

void Audio_setTitle(const char *format, ...) {
char buf[256];
va_list args;
va_start(args, format);
vsnprintf(buf, sizeof(buf) / sizeof(buf[0]), format, args);
vsnprintf(gPlayProperties.title, sizeof(gPlayProperties.title) / sizeof(gPlayProperties.title[0]), format, args);
va_end(args);
convertAsciiToUtf8(buf, gPlayProperties.title);

// notify web ui and mqtt
Web_SendWebsocketData(0, 30);
Expand Down
7 changes: 2 additions & 5 deletions src/Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,12 +1304,9 @@ void explorerHandleListRequest(AsyncWebServerRequest *request) {
String MyfileName = root.getNextFileName(&isDir);
while (MyfileName != "") {
// ignore hidden folders, e.g. MacOS spotlight files
if (!startsWith(MyfileName.c_str(), (char *) "/.")) {
if (!MyfileName.startsWith("/.")) {
JsonObject entry = obj.createNestedObject();
convertAsciiToUtf8(MyfileName.c_str(), filePath);
std::string path = filePath;
std::string fileName = path.substr(path.find_last_of("/") + 1);
entry["name"] = fileName;
entry["name"] = MyfileName.substring(MyfileName.lastIndexOf('/') + 1);
if (isDir) {
entry["dir"].set(true);
}
Expand Down

0 comments on commit 3e11c45

Please sign in to comment.