comparison src/track/media.cc @ 152:8700806c2cc2

dep/animia: awesome new breaking changes! I'm so tired
author Paper <mrpapersonic@gmail.com>
date Wed, 15 Nov 2023 02:34:59 -0500
parents e41505d24733
children bd439dd6ffc5
comparison
equal deleted inserted replaced
151:54744a48a7d7 152:8700806c2cc2
39 bool success = false; 39 bool success = false;
40 40
41 for (const auto& result : results) { 41 for (const auto& result : results) {
42 for (const auto& media : result.media) { 42 for (const auto& media : result.media) {
43 for (const auto& info : media.information) { 43 for (const auto& info : media.information) {
44 std::cout << static_cast<int>(info.type) << ": " << info.value << std::endl;
44 vec.push_back(info.value); 45 vec.push_back(info.value);
45 success |= true; 46 success |= true;
46 } 47 }
47 } 48 }
48 } 49 }
49 50
50 return success; 51 return success;
51 } 52 }
52 53
54 /* this sucks. use anitomy directly like a real man */
53 std::unordered_map<std::string, std::string> GetMapFromElements(const anitomy::Elements& elements) { 55 std::unordered_map<std::string, std::string> GetMapFromElements(const anitomy::Elements& elements) {
54 /* there are way more than this in anitomy, but we only need basic information
55 I also just prefer using maps than using the ".get()" stuff which is why I'm doing this */
56 std::unordered_map<std::string, std::string> ret; 56 std::unordered_map<std::string, std::string> ret;
57 57
58 ret["title"] = Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle)); 58 ret["title"] = Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle));
59 ret["filename"] = Strings::ToUtf8String(elements.get(anitomy::kElementFileName)); 59 ret["filename"] = Strings::ToUtf8String(elements.get(anitomy::kElementFileName));
60 ret["language"] = Strings::ToUtf8String(elements.get(anitomy::kElementLanguage)); 60 ret["language"] = Strings::ToUtf8String(elements.get(anitomy::kElementLanguage));