Skip to content

Commit

Permalink
Shared - Better Media URL Fetching
Browse files Browse the repository at this point in the history
Fixes #894
  • Loading branch information
nlogozzo committed Oct 14, 2024
1 parent c863d90 commit 58fc056
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion inno/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define MyAppName "Nickvision Parabolic"
#define MyAppShortName "Parabolic"
#define MyAppVersion "2024.10.1"
#define MyAppVersion "2024.10.2"
#define MyAppPublisher "Nickvision"
#define MyAppURL "https://nickvision.org"
#define MyAppExeName "org.nickvision.tubeconverter.qt.exe"
Expand Down
4 changes: 2 additions & 2 deletions libparabolic/src/controllers/mainwindowcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ namespace Nickvision::TubeConverter::Shared::Controllers
m_keyring{ m_appInfo.getId() },
m_downloadManager{ m_dataFileManager.get<Configuration>("config").getDownloaderOptions(), m_dataFileManager.get<DownloadHistory>("history"), m_logger }
{
m_appInfo.setVersion({ "2024.10.1" });
m_appInfo.setVersion({ "2024.10.2-next" });
m_appInfo.setShortName(_("Parabolic"));
m_appInfo.setDescription(_("Download web video and audio"));
m_appInfo.setChangelog("- Added the ability to specify the number of threads to use for postprocessing operations\n- Fixed an issue where the Add Download action was disabled incorrectly\n- Fixed an issue where a selected video resolution was ignored when downloading\n- Fixed an issue where the app crashed when attempting to use aria2c\n- Fixed an issue where the GNOME version of the app did not allow for scrolling on the download pages\n- Fixed an issue where the Qt version of the app did not display subtitle and playlist item rows correctly\n- Fixed an issue where the Qt version of the app did not respect dark mode on Windows 10\n- Updated yt-dlp to 2024.10.07");
m_appInfo.setChangelog("- Fixed an issue where some websites failed in 403 forbidden error");
m_appInfo.setSourceRepo("https://github.com/NickvisionApps/Parabolic");
m_appInfo.setIssueTracker("https://github.com/NickvisionApps/Parabolic/issues/new");
m_appInfo.setSupportUrl("https://github.com/NickvisionApps/Parabolic/discussions");
Expand Down
5 changes: 3 additions & 2 deletions libparabolic/src/models/downloaderoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ namespace Nickvision::TubeConverter::Shared::Models

void DownloaderOptions::setPostprocessingThreads(int threads)
{
if(threads < 1 || threads > std::thread::hardware_concurrency())
int hardwareThreads = static_cast<int>(std::thread::hardware_concurrency());
if(threads < 1 || threads > hardwareThreads)
{
threads = static_cast<int>(std::thread::hardware_concurrency());
threads = hardwareThreads;
}
m_postprocessingThreads = threads;
}
Expand Down
9 changes: 8 additions & 1 deletion libparabolic/src/models/media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ namespace Nickvision::TubeConverter::Shared::Models
: m_timeFrame{ std::chrono::seconds(0), std::chrono::seconds(0) }
{
//Parse base information
m_url = info.contains("url") ? (info["url"].is_string() ? info["url"].as_string() : "") : (info["webpage_url"].is_string() ? info["webpage_url"].as_string().c_str() : "");
if(info.contains("is_part_of_playlist"))
{
m_url = info.contains("url") ? (info["url"].is_string() ? info["url"].as_string() : "") : (info["webpage_url"].is_string() ? info["webpage_url"].as_string().c_str() : "");
}
else
{
m_url = info.contains("webpage_url") ? (info["webpage_url"].is_string() ? info["webpage_url"].as_string() : "") : (info["url"].is_string() ? info["url"].as_string() : "");
}
m_title = info["title"].is_string() ? info["title"].as_string() : "Media";
m_title = StringHelpers::normalizeForFilename(m_title, info["limit_characters"].is_bool() ? info["limit_characters"].as_bool() : false);
if(info.contains("duration"))
Expand Down
1 change: 1 addition & 0 deletions libparabolic/src/models/urlinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Nickvision::TubeConverter::Shared::Models
}
boost::json::object obj = entry.as_object();
obj["limit_characters"] = info["limit_characters"];
obj["is_part_of_playlist"] = true;
m_media.push_back({ obj, includeAutoGeneratedSubtitles, preferredVideoCodec });
}
}
Expand Down
11 changes: 2 additions & 9 deletions resources/linux/org.nickvision.tubeconverter.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,9 @@
<binary>@PROJECT_NAME@</binary>
</provides>
<releases>
<release version="2024.10.1" date="2024-10-13">
<release version="2024.10.2-next" date="2024-10-13">
<description translate="no">
<p>- Added the ability to specify the number of threads to use for postprocessing operations</p>
<p>- Fixed an issue where the Add Download action was disabled incorrectly</p>
<p>- Fixed an issue where a selected video resolution was ignored when downloading</p>
<p>- Fixed an issue where the app crashed when attempting to use aria2c</p>
<p>- Fixed an issue where the GNOME version of the app did not allow for scrolling on the download pages</p>
<p>- Fixed an issue where the Qt version of the app did not display subtitle and playlist item rows correctly</p>
<p>- Fixed an issue where the Qt version of the app did not respect dark mode on Windows 10</p>
<p>- Updated yt-dlp to 2024.10.07</p>
<p>- Fixed an issue where some websites failed in 403 forbidden error</p>
</description>
</release>
</releases>
Expand Down

0 comments on commit 58fc056

Please sign in to comment.