Skip to content

Commit

Permalink
Fix display of final "Scan done" message in Material skin.
Browse files Browse the repository at this point in the history
For whatever reason that message was missing when called from Material's status page.
  • Loading branch information
michaelherger committed Dec 10, 2024
1 parent 699dae0 commit ab80f7e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
4 changes: 3 additions & 1 deletion Changelog9.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h2><a name="v9.0.1" id="v9.0.1"></a>Version 9.0.1</h2>

<li>Server Changes:</li>
<ul>
<li>Analytics: only check asmall, well defined list of pref changes to decide whether a disconnected player had been active recently.</li>
<li>Analytics: only check a small, well defined list of pref changes to decide whether a disconnected player had been active recently.</li>
</ul>
<br />

Expand All @@ -17,12 +17,14 @@ <h2><a name="v9.0.1" id="v9.0.1"></a>Version 9.0.1</h2>
<li>Fix helper search path initialisation on older macOS using Perl 5.18.</li>
<li><a href="https://github.com/LMS-Community/slimserver-platforms/issues/74">#74</a> - Speed up Perl installation during an initial installation on Windows.</li>
<li><a href="https://github.com/LMS-Community/slimserver-platforms/issues/75">#75</a> - Make sure newly installed LMS on Windows is running before sending the user to the web page.</li>
<li><a href="https://github.com/LMS-Community/slimserver-platforms/issues/78">#78</a> - Fix crypto library linking issues in the Docker image.</li>
</ul>
<br />

<li>Bug Fixes:</li>
<ul>
<li>Only re-initialize menu settings for connected players - otherwise Analytics considers them "active" due to a prefs change.</li>
<li>Fix display of final "Scan done" message in Material skin.</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1235">#1235</a> - Need to utf8Decode album title for new &amp; changed (thanks @darrel-k!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1237">#1237</a> - Fix create table syntax for MySQL (MariaDB) (thanks @JKDingwall!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1238">#1238</a> - Merge multiple works per track into one single work (thanks @darrel-k!)</li>
Expand Down
42 changes: 24 additions & 18 deletions Slim/Web/Pages/Progress.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package Slim::Web::Pages::Progress;

# Logitech Media Server Copyright 2001-2024 Logitech.
# Lyrion Music Server Copyright 2024 Lyrion Community.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License,
# version 2.

use strict;

use Slim::Schema;
Expand All @@ -15,7 +21,7 @@ sub progress {
if ($params->{'abortScan'}) {
Slim::Music::Import->abortScan();
}

return undef if !Slim::Schema::hasLibrary();

my $total_time = 0;
Expand All @@ -39,72 +45,72 @@ sub progress {

my $bar;
my $barFinish = $p->finish ? $barLen : $p->total ? $p->done / $p->total * $barLen : -1;

for (my $i = 0; $i < $barLen; $i++) {
$bar .= ( $i <= $barFinish ) ? $bar1 : $bar0;
}

my $runtime = ((!$p->active && $p->finish) ? $p->finish : time()) - $p->start;

my $hrs = int($runtime / 3600);
my $mins = int(($runtime - $hrs * 3600)/60);
my $sec = $runtime - 3600 * $hrs - 60 * $mins;

my $item = {
'obj' => {},
'bar' => $bar,
'time' => sprintf("%02d:%02d:%02d", $hrs, $mins, $sec),
};

foreach ($p->columns) {
$item->{obj}->{$_} = $p->$_();
}

if ($p->name =~ /(.*)\|(.*)/) {
$item->{fullname} = string($2 . '_PROGRESS') . string('COLON') . ' ' . $1;
$item->{obj}->{name} = $2;
}

$total_time += $runtime;

push @{$params->{'progress_items'}}, $item;

}
else {
$failure = $p->info || 1;
}

$finished = $p->finish;
}

$params->{'desc'} = 1;

# special message for importers once finished
if ($params->{'type'} && $params->{'type'} eq 'importer' && !Slim::Music::Import->stillScanning) {
if (!Slim::Music::Import->stillScanning) {

if (@progress) {

if ($failure) {
$params->{'message'} = '?';

if ($failure eq 'SCAN_ABORTED') {
$params->{'message'} = string($failure);
$params->{'message'} = string($failure);
}
elsif ($failure ne '1') {
$params->{'message'} = string('FAILURE_PROGRESS', string($failure . '_PROGRESS'));
$params->{'message'} = string('FAILURE_PROGRESS', string($failure . '_PROGRESS'));
}

$params->{'failed'} = $failure;
}
else {
$params->{'message'} = string('PROGRESS_IMPORTER_COMPLETE_DESC');
}


my $hrs = int($total_time / 3600);
my $mins = int(($total_time - $hrs * 3600)/60);
my $sec = $total_time - 3600 * $hrs - 60 * $mins;

$params->{'total_time'} = sprintf("%02d:%02d:%02d", $hrs, $mins, $sec);
$params->{'total_time'} .= '&nbsp;(' . Slim::Utils::DateTime::longDateF($finished) . ' / ' . Slim::Utils::DateTime::timeF($finished) . ')' if $finished;

Expand Down

0 comments on commit ab80f7e

Please sign in to comment.