Skip to content

Commit 6d100be

Browse files
author
dogatech
committed
fix setting release date from yt music
1 parent 20e7c83 commit 6d100be

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

be/src/MusicVideoService.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ vector<string> MusicVideoService::downloadAudio(const string& url) {
125125
album->setName(ptree.get<string>("album"));
126126
song->setTrack(ptree.get<string>("playlist_index"));
127127
date = ptree.get<string>("release_date", "00000000");
128+
if (!date.compare("null") || !date.compare("00000000")) {
129+
string songDescription = ptree.get<string>("description");
130+
boost::regex descReleasedRegex("Released on: (\\d{4})-(\\d{2})-(\\d{2})\\b");
131+
boost::smatch match;
132+
if (boost::regex_search(songDescription, match, descReleasedRegex, boost::match_extra)) {
133+
date = match[1] + match[2] + match[3];
134+
}
135+
}
128136
if (!date.compare("null") || !date.compare("00000000")) {
129137
int yr = ptree.get<int>("release_year", 0);
130138
if (yr > 0) date = std::to_string(yr) + "0000";

fe/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "SoulSifter",
33
"version": "1.5.2",
44
"description": "DJ & music organization app.",
5-
"build": 3000,
5+
"build": 3003,
66
"main": "main.js",
77
"scripts": {
88
"fe:build": "vite build",

0 commit comments

Comments
 (0)