aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/utils/EpisodeNameParser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/utils/EpisodeNameParser.cpp b/src/plugins/utils/EpisodeNameParser.cpp
index 8610ab0..8141421 100644
--- a/src/plugins/utils/EpisodeNameParser.cpp
+++ b/src/plugins/utils/EpisodeNameParser.cpp
@@ -108,6 +108,12 @@ namespace QuickMedia {
return (c >= '0' && c <= '9') || c == '.';
}
+ static void remove_trailing_characters(std::string_view &str, char c) {
+ while(!str.empty() && str.back() == c) {
+ str.remove_suffix(1);
+ }
+ }
+
static std::string_view episode_name_extract_episode(std::string_view &episode_name) {
episode_name = strip_left(episode_name);
size_t i = 0;
@@ -120,6 +126,7 @@ namespace QuickMedia {
return {};
std::string_view episode = episode_name.substr(0, i);
+ remove_trailing_characters(episode, '.');
episode_name.remove_prefix(i + 1);
return episode;
}