Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors and visuals for multiline track infos #311

Merged
merged 2 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion themes/eole/js/WSHcontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ function get_text(metadb) {

if(properties.custom_firstRow=="") {
var infos = properties.default_firstRow.Eval();
infos = infos.split(" ^^ ");
infos = infos.replace(/\r?\n/gm, ' ').split(" ^^ ");
g_text_title = infos[1];
if(infos[2]) g_text_artist = " - "+infos[2];
if (properties.showTrackPrefix) g_text_title_prefix = infos[0]+". ";
Expand Down
13 changes: 7 additions & 6 deletions themes/eole/js/WSHgraphicbrowser_trackinfos.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ oRow = function(metadb,itemIndex) {
var TagsString = TF.titleB.EvalWithMetadb(metadb);
} else
var TagsString = TF.title.EvalWithMetadb(metadb);
Tags = TagsString.split(" ^^ ");
Tags = TagsString.replace(/\r?\n/gm, ' ').split(" ^^ ");

this.artist = Tags[0];
if(this.artist=="?") this.artist="Unknown artist";
Expand Down Expand Up @@ -4398,7 +4398,7 @@ oBrowser = function(name) {
trackinfos = TF.grouping_default_filterbox.EvalWithMetadb(this.list[k]);
this.current_grouping = properties.TFgrouping_default;
}
arr = trackinfos.split(" ^^ ");
arr = trackinfos.replace(/\r?\n/gm, ' ').split(" ^^ ");
group_string = arr[0]+arr[1];
} else {
if(properties.SingleMultiDisc) {
Expand All @@ -4419,7 +4419,7 @@ oBrowser = function(name) {

if(i>0) {
if(this.custom_groupby) {
var groupinfos_rows = TF.grouping.EvalWithMetadb(this.groups[i-1].pl[0]).split(" ^^ ");
var groupinfos_rows = TF.grouping.EvalWithMetadb(this.groups[i-1].pl[0]).replace(/\r?\n/gm, ' ').split(" ^^ ");
this.groups[i-1].firstRow = groupinfos_rows[0];
this.groups[i-1].secondRow = (groupinfos_rows[1]!="")?groupinfos_rows[1]:this.groups[i-1].pl.Count+(this.groups[i-1].pl.Count>1?" tracks":" track");
} else {
Expand All @@ -4436,24 +4436,25 @@ oBrowser = function(name) {

if(properties.TFgrouping.length > 0) {
groupinfoscustom = TF.groupinfoscustom.EvalWithMetadb(this.list[k]);
groupinfoscustom = groupinfoscustom.split(" ^^ ");
groupinfoscustom = groupinfoscustom.replace(/\r?\n/gm, ' ').split(" ^^ ");
this.groups[i].artist = groupinfoscustom[0];
this.groups[i].album = groupinfoscustom[1];
this.groups[i].genre = groupinfoscustom[2];
this.groups[i].date = groupinfoscustom[3];
this.groups[i].discnb = groupinfoscustom[4];
this.groups[i].cachekey = process_cachekey(this.list[k]);
} else {
if(!this.showFilterBox) arr = trackinfos.split(" ^^ ");
if(!this.showFilterBox) arr = trackinfos.replace(/\r?\n/gm, ' ').split(" ^^ ");
groupinfos = TF.groupinfos.EvalWithMetadb(this.list[k]);
groupinfos = groupinfos.split(" ^^ ");
groupinfos = groupinfos.replace(/\r?\n/gm, ' ').split(" ^^ ");
this.groups[i].artist = arr[0];
this.groups[i].album = arr[1];
this.groups[i].genre = groupinfos[0];
this.groups[i].date = groupinfos[1];
this.groups[i].discnb = groupinfos[2];
this.groups[i].cachekey = process_cachekey(this.list[k],'',groupinfos[3]);
}

if(this.groups[i].album=="?") this.groups[i].album="Single(s)";
if(this.groups[i].artist=="?") this.groups[i].artist="Unknown artist(s)";
if(this.groups[i].genre=="?") this.groups[i].genre="";
Expand Down
2 changes: 1 addition & 1 deletion themes/eole/js/WSHnowplaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ function oInfos() {
this.getTrackInfosCustom();
} else {
var defaultinfos = g_tfo.defaultinfos.EvalWithMetadb(this.metadb);
defaultinfos = defaultinfos.split(" ^^ ");
defaultinfos = defaultinfos.replace(/\r?\n/gm, ' ').split(" ^^ ");

this.rating = defaultinfos[0];

Expand Down
22 changes: 11 additions & 11 deletions themes/eole/js/WSHsmoothplaylist_trackinfos.js
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ oBrowser = function(name) {
var str_filter = process_string(filter_text);
for(var i = 0; i < total; i++) {
handle = this.list[i];
arr = tf.EvalWithMetadb(handle).split(/ ## (.*)/);
arr = tf.EvalWithMetadb(handle).replace(/\r?\n/gm, ' ').split(/ ## ([^]*)/);
current = arr[0].toLowerCase();
if(str_filter.length > 0) {
var toAdd = match(arr[0]+" "+arr[1], str_filter);
Expand Down Expand Up @@ -2186,18 +2186,18 @@ oBrowser = function(name) {
switch(this.rows[i].type) {
case this.groupHeaderRowHeight: // last group header row
// group tags
this.rows[i].groupkey = tf_grp.EvalWithMetadb(this.rows[i].metadb);
this.rows[i].groupkey = tf_grp.EvalWithMetadb(this.rows[i].metadb).replace(/\r?\n/mg, ' ');
this.rows[i].groupkeysplit = this.rows[i].groupkey.split(" ^^ ");
// track tags
this.rows[i].infosraw = tf_trk.EvalWithMetadb(this.rows[i].metadb);
this.rows[i].infosraw = tf_trk.EvalWithMetadb(this.rows[i].metadb).replace(/\r?\n/mg, ' ');
this.rows[i].infos = this.rows[i].infosraw.split(" ^^ ");
break;
case 0: // track row
// group tags
this.rows[i].groupkey = tf_grp.EvalWithMetadb(this.rows[i].metadb);
this.rows[i].groupkey = tf_grp.EvalWithMetadb(this.rows[i].metadb).replace(/\r?\n/mg, ' ');
this.rows[i].groupkeysplit = this.rows[i].groupkey.split(" ^^ ");
// track tags
this.rows[i].infosraw = tf_trk.EvalWithMetadb(this.rows[i].metadb);
this.rows[i].infosraw = tf_trk.EvalWithMetadb(this.rows[i].metadb).replace(/\r?\n/mg, ' ');
this.rows[i].infos = this.rows[i].infosraw.split(" ^^ ");
break;
};
Expand All @@ -2209,12 +2209,12 @@ oBrowser = function(name) {
switch(this.rows[g_start_].type) {
case this.groupHeaderRowHeight: // last group header row
// track tags
this.rows[g_start_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_start_].metadb);
this.rows[g_start_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_start_].metadb).replace(/\r?\n/mg, ' ');
this.rows[g_start_].infos = this.rows[g_start_].infosraw.split(" ^^ ");
break;
case 0: // track row
// track tags
this.rows[g_start_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_start_].metadb);
this.rows[g_start_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_start_].metadb).replace(/\r?\n/mg, ' ');
this.rows[g_start_].infos = this.rows[g_start_].infosraw.split(" ^^ ");
break;
};
Expand All @@ -2224,12 +2224,12 @@ oBrowser = function(name) {
switch(this.rows[g_end_].type) {
case this.groupHeaderRowHeight: // last group header row
// track tags
this.rows[g_end_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_end_].metadb);
this.rows[g_end_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_end_].metadb).replace(/\r?\n/mg, ' ');
this.rows[g_end_].infos = this.rows[g_end_].infosraw.split(" ^^ ");
break;
case 0: // track row
// track tags
this.rows[g_end_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_end_].metadb);
this.rows[g_end_].infosraw = tf_trk.EvalWithMetadb(this.rows[g_end_].metadb).replace(/\r?\n/mg, ' ');
this.rows[g_end_].infos = this.rows[g_end_].infosraw.split(" ^^ ");
break;
};
Expand Down Expand Up @@ -2512,9 +2512,9 @@ oBrowser = function(name) {
// =====
// text
// =====



arr_e[2]=arr_e[2].replace(/\s+/g, " ");
arr_e[2]=arr_e[2].replace(/\s+/g, " ");
if(!isDefined(this.groups[g].row1_Width)) this.groups[g].row1_Width = gr.CalcTextWidth(this.groups[g].group_header_row_1, g_font.italicplus3);
if(!isDefined(this.groups[g].row2_Width)) this.groups[g].row2_Width = gr.CalcTextWidth(this.groups[g].group_header_row_2, g_font.normal);
if(!isDefined(this.groups[g].timeWidth)) this.groups[g].timeWidth = gr.CalcTextWidth(this.groups[g].TimeString, ((properties.doubleRowText)?g_font.normal:g_font.min1)) + 10;
Expand Down
2 changes: 1 addition & 1 deletion themes/eole/js/WSHtitle_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ function on_playback_new_track(metadb){
}
function eval_caption_title(metadb){
if(metadb)
caption_title = fb.TitleFormat(properties.tracktitle_format).EvalWithMetadb(metadb);
caption_title = fb.TitleFormat(properties.tracktitle_format).EvalWithMetadb(metadb).replace(/\r?\n/gm, ' ');
}
function on_playback_stop(reason) {
switch(reason) {
Expand Down