Skip to content

Commit

Permalink
Merge pull request #311 from bloodwiing/master
Browse files Browse the repository at this point in the history
Fix errors and visuals for multiline track infos
  • Loading branch information
Ottodix authored Oct 19, 2024
2 parents 579bab3 + f32a957 commit be0f989
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
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 @@ -900,7 +900,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 @@ -4476,7 +4476,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 @@ -4497,7 +4497,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 @@ -4514,24 +4514,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

0 comments on commit be0f989

Please sign in to comment.