Skip to content

Commit

Permalink
fix: bye bye switchMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Nov 13, 2024
1 parent f2655cc commit 6ad544b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
6 changes: 1 addition & 5 deletions src/download/youtube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
#include <string>

#include "Geode/Result.hpp"
#include "Geode/utils/general.hpp"
#include "Geode/utils/web.hpp"

#include "download/download.hpp"
#include "download/hosted.hpp"
#include "utils/task.hpp"

using namespace geode::prelude;

Expand All @@ -26,9 +24,7 @@ DownloadTask startYoutubeDownload(const std::string& id) {
return DownloadTask::immediate(Err("Invalid YouTube ID"));
}

return jukebox::switchMap<web::WebResponse, web::WebProgress,
Result<ByteVector>, float>(
getMetadata(id), [](web::WebResponse* r) { return onMetadata(r); });
return getMetadata(id).chain([](web::WebResponse* r) { return onMetadata(r); });
}

} // namespace download
Expand Down
31 changes: 0 additions & 31 deletions src/utils/task.hpp

This file was deleted.

0 comments on commit 6ad544b

Please sign in to comment.