Skip to content

Commit a6c9259

Browse files
author
fooDayuyu@gmail.com
committed
Show format info in Find Release version list (Cont)
1 parent 99bd9d3 commit a6c9259

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

conf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class new_conf
339339
raw_remove_exclude_tags = s;
340340
}
341341

342-
formatting_script search_release_format_string = "$join($append(%RELEASE_TITLE%,%RELEASE_SEARCH_LABELS%,%RELEASE_SEARCH_FORMATS%,%RELEASE_YEAR%,%RELEASE_SEARCH_CATNOS%))";
342+
formatting_script search_release_format_string = "$join($append(%RELEASE_TITLE%,%RELEASE_SEARCH_LABELS%,%RELEASE_SEARCH_MAJOR_FORMATS%,%RELEASE_SEARCH_FORMATS%,%RELEASE_YEAR%,%RELEASE_SEARCH_CATNOS%))";
343343
formatting_script search_master_format_string = "'[master] '$join($append(%MASTER_RELEASE_TITLE%,%MASTER_RELEASE_YEAR%))";
344344
formatting_script search_master_sub_format_string = "' '$ifequal(%RELEASE_ID%,%MASTER_RELEASE_MAIN_RELEASE_ID%,'* ',' ')$join($append(%RELEASE_TITLE%,%RELEASE_SEARCH_LABELS%,%RELEASE_SEARCH_MAJOR_FORMATS%,%RELEASE_SEARCH_FORMATS%,%RELEASE_YEAR%,%RELEASE_SEARCH_CATNOS%,%RELEASE_COUNTRY%))";
345345

discogs.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,8 +1144,17 @@ void Discogs::parseArtistReleases(json_t *root, Artist *artist) {
11441144
Release_ptr release = discogs_interface->get_release(JSONAttributeString(rel, "id"));
11451145
release->title = JSONAttributeString(rel, "title");
11461146
release->search_labels = JSONAttributeString(rel, "label");
1147-
release->search_major_formats = JSONAttributeStringArray(rel, "major_formats");
1148-
release->search_formats = JSONAttributeString(rel, "format");
1147+
1148+
//extract major_formats from first csv element
1149+
pfc::string8 all_formats = JSONAttributeString(rel, "format");
1150+
pfc::array_t<pfc::string8> flist;
1151+
tokenize(all_formats, ",", flist, false);
1152+
//release->search_major_formats:
1153+
tokenize(flist[0], ",", release->search_major_formats, false);
1154+
t_size formats_cpos = flist[0].get_length();
1155+
//release->search_formats:
1156+
release->search_formats = ltrim(substr(all_formats, formats_cpos + 1, /*pfc_infinite*/ all_formats.get_length() - formats_cpos));
1157+
11491158
release->search_catno = JSONAttributeString(rel, "catno");
11501159
release->release_year = JSONAttributeString(rel, "year");
11511160
if (release->release_year.get_length() == 0) {

0 commit comments

Comments
 (0)