Mercurial > minori
diff src/track/media.cc @ 153:bd439dd6ffc5
*: make win stuff actually work, rename bsd.cc to xnu.cc
It's been OS X only for ages, and these functions are different between
most BSDs anyway
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 15 Nov 2023 13:28:18 -0500 |
parents | 8700806c2cc2 |
children | d43d68408d3c |
line wrap: on
line diff
--- a/src/track/media.cc Wed Nov 15 02:34:59 2023 -0500 +++ b/src/track/media.cc Wed Nov 15 13:28:18 2023 -0500 @@ -41,6 +41,9 @@ for (const auto& result : results) { for (const auto& media : result.media) { for (const auto& info : media.information) { + switch (info.type) { + case + } std::cout << static_cast<int>(info.type) << ": " << info.value << std::endl; vec.push_back(info.value); success |= true; @@ -51,33 +54,5 @@ return success; } -/* this sucks. use anitomy directly like a real man */ -std::unordered_map<std::string, std::string> GetMapFromElements(const anitomy::Elements& elements) { - std::unordered_map<std::string, std::string> ret; - - ret["title"] = Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle)); - ret["filename"] = Strings::ToUtf8String(elements.get(anitomy::kElementFileName)); - ret["language"] = Strings::ToUtf8String(elements.get(anitomy::kElementLanguage)); - ret["group"] = Strings::ToUtf8String(elements.get(anitomy::kElementReleaseGroup)); - ret["episode"] = Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber)); - ret["resolution"] = Strings::ToUtf8String(elements.get(anitomy::kElementVideoResolution)); - - return ret; -} - -std::unordered_map<std::string, std::string> GetFileElements(const std::string& basename) { - anitomy::Anitomy anitomy; - anitomy.Parse(Strings::ToWstring(basename)); - - return GetMapFromElements(anitomy.elements()); -} - -std::unordered_map<std::string, std::string> GetFileElements(const std::filesystem::path& path) { - anitomy::Anitomy anitomy; - anitomy.Parse(path.filename().wstring()); - - return GetMapFromElements(anitomy.elements()); -} - } // namespace Media } // namespace Track