MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / ScanSidTuneInfo

Function ScanSidTuneInfo

src/decoder/plugins/SidplayDecoderPlugin.cxx:458–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static void
459ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks,
460 TagHandler &handler) noexcept
461{
462 /* album */
463 const auto album = GetInfoString(info, 0);
464
465 handler.OnTag(TAG_ALBUM, album.c_str());
466
467 if (n_tracks > 1) {
468 const auto tag_title =
469 fmt::format("{} ({}/{})",
470 album.c_str(), track, n_tracks);
471 handler.OnTag(TAG_TITLE, tag_title.c_str());
472 } else
473 handler.OnTag(TAG_TITLE, album.c_str());
474
475 /* artist */
476 const auto artist = GetInfoString(info, 1);
477 if (!artist.empty())
478 handler.OnTag(TAG_ARTIST, artist.c_str());
479
480 /* genre */
481 if (!sidplay_global->default_genre.empty())
482 handler.OnTag(TAG_GENRE,
483 sidplay_global->default_genre.c_str());
484
485 /* date */
486 const auto date = GetDateString(info);
487 if (!date.empty())
488 handler.OnTag(TAG_DATE, date.c_str());
489
490 /* track */
491 handler.OnTag(TAG_TRACK, fmt::format_int{track}.c_str());
492}
493
494static bool
495sidplay_scan_file(Path path_fs, TagHandler &handler) noexcept

Callers 2

sidplay_scan_fileFunction · 0.85
sidplay_container_scanFunction · 0.85

Calls 4

GetInfoStringFunction · 0.85
GetDateStringFunction · 0.85
emptyMethod · 0.80
OnTagMethod · 0.45

Tested by

no test coverage detected