aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/LocalAnime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/LocalAnime.cpp')
-rw-r--r--src/plugins/LocalAnime.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp
index 59e52ad..0febb23 100644
--- a/src/plugins/LocalAnime.cpp
+++ b/src/plugins/LocalAnime.cpp
@@ -55,7 +55,7 @@ namespace QuickMedia {
return season.name;
} else if(std::holds_alternative<LocalAnimeEpisode>(item)) {
const LocalAnimeEpisode &episode = std::get<LocalAnimeEpisode>(item);
- return episode.path.filename();
+ return episode.name;
} else {
return {};
}
@@ -139,13 +139,15 @@ namespace QuickMedia {
std::vector<LocalAnimeItem> grouped_items;
for(LocalAnimeItem &item : items) {
if(std::holds_alternative<LocalAnimeEpisode>(item)) {
- const LocalAnimeEpisode &episode = std::get<LocalAnimeEpisode>(item);
+ LocalAnimeEpisode &episode = std::get<LocalAnimeEpisode>(item);
std::optional<EpisodeNameParts> name_parts = episode_name_extract_parts(episode.path.filename());
if(!name_parts) {
grouped_items.push_back(std::move(item));
continue;
}
+ episode.name = name_parts->episode;
+
GroupedAnime &grouped_anime = anime_by_name[name_parts->anime];
if(grouped_anime.anime.name.empty())
grouped_anime.anime.name = name_parts->anime;
@@ -198,7 +200,7 @@ namespace QuickMedia {
if(!file_get_last_modified_time_seconds(filepath.data.c_str(), &modified_time_seconds))
return true;
- episodes.push_back(LocalAnimeEpisode{ filepath, modified_time_seconds });
+ episodes.push_back(LocalAnimeEpisode{ filepath.data, filepath, modified_time_seconds });
return true;
}, FileSortDirection::DESC);
return episodes;
@@ -214,7 +216,7 @@ namespace QuickMedia {
return true;
}
- anime_items.push_back(LocalAnimeEpisode{ filepath, last_modified_seconds });
+ anime_items.push_back(LocalAnimeEpisode{ filepath.data, filepath, last_modified_seconds });
}
return true;
}
@@ -253,7 +255,7 @@ namespace QuickMedia {
return true;
}
- anime_items.push_back(LocalAnimeEpisode{ filepath, last_modified_seconds });
+ anime_items.push_back(LocalAnimeEpisode{ filepath.data, filepath, last_modified_seconds });
}
return true;
}