aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DownloadUtils.cpp11
-rw-r--r--src/QuickMedia.cpp4
2 files changed, 7 insertions, 8 deletions
diff --git a/src/DownloadUtils.cpp b/src/DownloadUtils.cpp
index 9834390..774fba9 100644
--- a/src/DownloadUtils.cpp
+++ b/src/DownloadUtils.cpp
@@ -214,11 +214,12 @@ namespace QuickMedia {
}
bool download_async_gui(const std::string &url, const std::string &file_manager_start_dir, bool use_youtube_dl, bool no_video) {
- // TODO: Fix this not working when installed to /usr/bin/quickmedia for some reason
- //char quickmedia_path[PATH_MAX];
- //if(readlink("/proc/self/exe", quickmedia_path, sizeof(quickmedia_path)) == -1)
- // strcpy(quickmedia_path, "quickmedia");
- const char *quickmedia_path = "quickmedia";
+ char quickmedia_path[PATH_MAX];
+ ssize_t bytes_written = readlink("/proc/self/exe", quickmedia_path, sizeof(quickmedia_path));
+ if(bytes_written == -1 || bytes_written == sizeof(quickmedia_path))
+ strcpy(quickmedia_path, "quickmedia");
+ else
+ quickmedia_path[bytes_written] = '\0';
std::vector<const char*> args = { quickmedia_path, "download", "-u", url.c_str(), "--dir", file_manager_start_dir.c_str() };
if(use_youtube_dl) args.push_back("--youtube-dl");
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 595ae7b..5bbad84 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1889,9 +1889,7 @@ namespace QuickMedia {
BodyItem *selected_item = tabs[selected_tab].body->get_selected();
if(selected_item && tabs[selected_tab].page->is_trackable()) {
TrackablePage *trackable_page = dynamic_cast<TrackablePage*>(tabs[selected_tab].page.get());
- run_task_with_loading_screen([trackable_page, selected_item](){
- return trackable_page->track(selected_item->get_title()) == TrackResult::OK;
- });
+ trackable_page->track(selected_item->get_title());
}
} else if(event.key.code == sf::Keyboard::C && event.key.control) {
BodyItem *selected_item = tabs[selected_tab].body->get_selected();