comparison src/track/media.cc @ 114:ab191e28e69d

*: add initial torrent stuff WOAH! these checkboxes are a pain in my fucking ass
author Paper <mrpapersonic@gmail.com>
date Tue, 07 Nov 2023 08:03:42 -0500
parents 2004b41d4a59
children 39521c47c7a3
comparison
equal deleted inserted replaced
113:32afe0e940bf 114:ab191e28e69d
38 ret["title"] = Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle)); 38 ret["title"] = Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle));
39 ret["filename"] = Strings::ToUtf8String(elements.get(anitomy::kElementFileName)); 39 ret["filename"] = Strings::ToUtf8String(elements.get(anitomy::kElementFileName));
40 ret["language"] = Strings::ToUtf8String(elements.get(anitomy::kElementLanguage)); 40 ret["language"] = Strings::ToUtf8String(elements.get(anitomy::kElementLanguage));
41 ret["group"] = Strings::ToUtf8String(elements.get(anitomy::kElementReleaseGroup)); 41 ret["group"] = Strings::ToUtf8String(elements.get(anitomy::kElementReleaseGroup));
42 ret["episode"] = Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber)); 42 ret["episode"] = Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber));
43 ret["resolution"] = Strings::ToUtf8String(elements.get(anitomy::kElementVideoResolution));
43 44
44 return ret; 45 return ret;
46 }
47
48 std::unordered_map<std::string, std::string> GetFileElements(std::string basename) {
49 anitomy::Anitomy anitomy;
50 anitomy.Parse(Strings::ToWstring(basename));
51
52 return GetMapFromElements(anitomy.elements());
45 } 53 }
46 54
47 std::unordered_map<std::string, std::string> GetFileElements(Filesystem::Path path) { 55 std::unordered_map<std::string, std::string> GetFileElements(Filesystem::Path path) {
48 anitomy::Anitomy anitomy; 56 anitomy::Anitomy anitomy;
49 anitomy.Parse(Strings::ToWstring(path.Basename())); 57 anitomy.Parse(Strings::ToWstring(path.Basename()));