Skip to content

Commit

Permalink
don't count directories when counting children of opened dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ravachol committed Nov 20, 2024
1 parent d485166 commit 88ff0a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,9 @@ int displayTree(FileSystemEntry *root, int depth, int maxListSize, int maxNameWi

while (tmpc != NULL)
{
tmpc = tmpc->next;
libCurrentDirSongCount++;
if (!tmpc->isDirectory)
libCurrentDirSongCount++;
tmpc = tmpc->next;
}

lastEntry = currentEntry;
Expand Down Expand Up @@ -1291,6 +1292,7 @@ void showLibrary(SongData *songData, AppState *state)
chosenLibRow -= state->uiState.numSongsAboveSubDir;
state->uiState.openedSubDir = false;
state->uiState.numSongsAboveSubDir = 0;
previouslyAllowedChooseSongs = false;
}
}
else
Expand Down
6 changes: 3 additions & 3 deletions src/playerops.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,10 @@ void enqueueSongs(FileSystemEntry *entry, UIState *uis)

while (tmpc != NULL)
{
if (strcmp(entry->fullPath, tmpc->fullPath) == 0)
break;
tmpc = tmpc->next;
uis->numSongsAboveSubDir++;
if (tmpc != NULL && strcmp(entry->fullPath, tmpc->fullPath) == 0)
break;
uis->numSongsAboveSubDir++;
}
}
setCurrentAsChosenDir();
Expand Down

0 comments on commit 88ff0a1

Please sign in to comment.