diff src/gui/pages/torrents.cc @ 264:9a04802848c0

*: improve multiple things e.g. making some strings.cc functions modify strings in-place, improving m4_ax_have_qt.m4 code, making anime_db.cc rely on std::optional rather than std::shared_ptr (which was stupid anyway)
author Paper <paper@paper.us.eu.org>
date Thu, 11 Apr 2024 10:15:57 -0400
parents dd211ff68b36
children f31305b9f60a
line wrap: on
line diff
--- a/src/gui/pages/torrents.cc	Wed Apr 03 20:46:40 2024 -0400
+++ b/src/gui/pages/torrents.cc	Thu Apr 11 10:15:57 2024 -0400
@@ -151,8 +151,9 @@
 
 			/* todo: patch Anitomy so that it doesn't use wide strings */
 			torrent.SetTitle(Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle)));
-			torrent.SetEpisode(
-			    Strings::RemoveLeadingChars(Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber)), '0'));
+			std::string episode = Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber));
+			Strings::RemoveLeadingChars(episode, '0');
+			torrent.SetEpisode(episode);
 			torrent.SetGroup(Strings::ToUtf8String(elements.get(anitomy::kElementReleaseGroup)));
 			torrent.SetResolution(Strings::ToUtf8String(elements.get(anitomy::kElementVideoResolution)));
 		}