Skip to content

Commit

Permalink
medialib: resolve FIXME: corrected comment about track_uris
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed Nov 13, 2022
1 parent 2050704 commit 5c9ef7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions plugins/medialib/medialibdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ typedef struct {
ml_collection_t genres;
ml_collection_t folders;

// This hash is formed from track_uri ([%:TRACKNUM%#]%:URI%), and supposed to have all tracks which exist in the library (including subtracks).
// Main purpose is to find a library instance of a track for given track pointer.
// FIXME: the hashing doesn't seem to be using "tracknum+uri" -- needs to be verified / fixed.
// This hash is formed from track_uri (filename),
// and each node contains all tracks for the given filename.
// It is used to update the already scanned tracks during rescans.
ml_collection_t track_uris;

/// Selected / expanded state.
Expand Down
8 changes: 4 additions & 4 deletions plugins/medialib/medialibscanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ ml_filter_int (ddb_file_found_data_t *data, time_t mtime, scanner_state_t *state
res = -1;

// Copy from medialib playlist into scanner state
ml_collection_tree_node_t *str = ml_collection_hash_find (state->source->db.track_uris.hash, s);
if (str) {
for (ml_collection_track_ref_t *item = str->items; item; item = item->next) {
ml_collection_tree_node_t *node = ml_collection_hash_find (state->source->db.track_uris.hash, s);
if (node) {
for (ml_collection_track_ref_t *item = node->items; item; item = item->next) {
const char *stimestamp = deadbeef->pl_find_meta (item->it, ":MEDIALIB_SCAN_TIME");
if (!stimestamp) {
// no scan time
Expand All @@ -273,7 +273,7 @@ ml_filter_int (ddb_file_found_data_t *data, time_t mtime, scanner_state_t *state
}
}

for (ml_collection_track_ref_t *item = str->items; item; item = item->next) {
for (ml_collection_track_ref_t *item = node->items; item; item = item->next) {
// Because of cuesheets, the same track may get added multiple times,
// since all items reference the same filename.
// Check if this track is still in ml_playlist
Expand Down

0 comments on commit 5c9ef7e

Please sign in to comment.