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

Merge hotfix-3-0-0-rc-4 #424

Merged
merged 40 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
72987f0
fixed request parameter defaults
RocketMan Aug 20, 2023
6211b93
simplified logic (non-semantic change)
RocketMan Aug 20, 2023
0b699f6
fixed catcodes macro for empty category
RocketMan Aug 23, 2023
ad1954b
fixed albums with no sizzle so they are sortable
RocketMan Aug 23, 2023
ae181b2
Revert "fixed albums with no sizzle so they are sortable"
RocketMan Aug 23, 2023
d461272
fixed review post/edit to work on Safari mobile
RocketMan Aug 23, 2023
2740112
replaced deprecated jQuery constructs identified by jquery-migrate-3.…
RocketMan Aug 24, 2023
f800b90
fixed link in RSS adds feed
RocketMan Aug 24, 2023
ecd0c1a
finessed discogs artist matching; added artwork refresh CLI
RocketMan Aug 30, 2023
e4df825
added optional skip param to artwork:reload
RocketMan Sep 2, 2023
480b862
removed superfluous use directives (non-semantic change)
RocketMan Sep 2, 2023
65550f4
migrated parent dir reference to use dirname (non-semantic change)
RocketMan Sep 2, 2023
9d4169c
refreshed printed tags
RocketMan Sep 4, 2023
889e004
added fallback support for Greek codepoints
RocketMan Sep 5, 2023
f4222cb
added album creation date to printed tag
RocketMan Sep 6, 2023
557b4c0
updated rocketman/pdf-label
RocketMan Sep 8, 2023
82b2c11
more updates to rocketman/pdf-label
RocketMan Sep 8, 2023
fbabfa1
yet more updates to rocketman/pdf-label
RocketMan Sep 9, 2023
84dcce4
fixed URL prefixing
RocketMan Sep 9, 2023
4109a23
changed QR code to use short tag reference
RocketMan Sep 10, 2023
66b3d9e
import: don't override artist for in-library compilations
RocketMan Sep 13, 2023
7bef7d5
rss: fixed link in invalid response
RocketMan Sep 25, 2023
f58bde3
added transliteration of cyrillic and greek to latin for ASCII/latin1…
RocketMan Oct 8, 2023
7292008
updated getActiveReviewers to suppress private-only reviewers for pub…
RocketMan Oct 12, 2023
ff4f3af
finessed previous commit for case reviews published under own name
RocketMan Oct 12, 2023
7ebabdd
swap artist names only if album is from library
RocketMan Oct 16, 2023
d954acd
Electronic genre name change
RocketMan Oct 16, 2023
30ee166
fixed reporting category alignment in Adds panel
RocketMan Oct 16, 2023
9b6f135
added album hashtags
RocketMan Oct 17, 2023
7d7f67f
fixed full text search for reviews under real name
RocketMan Oct 17, 2023
0a2778a
allow camelcase hashtags; show tags from more recent reviews last
RocketMan Oct 18, 2023
89bab57
added Electronic and Loud subcategories for General
RocketMan Oct 19, 2023
478c643
finessed hashtag layout
RocketMan Oct 19, 2023
d0f493a
lightened hashtag bubble border; prettied html (non-semantic change)
RocketMan Oct 19, 2023
7ff78a2
modified hashtag to allow numbers but not as first character
RocketMan Oct 21, 2023
d932e2f
updated hashtags for unicode
RocketMan Oct 21, 2023
af5e72c
tighten subcategory placement on printed label
RocketMan Oct 23, 2023
28e5eb7
fade in recently played images; updated recently played link alt text
RocketMan Oct 24, 2023
878565f
adjusted maximum printed album title and genre length to 32
RocketMan Oct 26, 2023
850e0f5
fixed artist name swap in getPlaysBefore
RocketMan Oct 27, 2023
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: 2 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ RewriteEngine on
RewriteRule ^zkrss\.php$ index.php?target=rss [QSA,L]
RewriteRule ^zk-feed-reader\.xslt$ controllers/RSS.xslt [QSA,L]
RewriteRule ^ssoLogin\.php$ index.php?target=sso [QSA,L]
RewriteCond %{REQUEST_URI} ^(.*)/tag/([0-9]+)$
RewriteRule .* %1/?action=search&s=byAlbumKey&n=%2 [R=302]
RewriteCond $0 !^\.mdhandler.php/.*$
RewriteRule ^(.+)\.md$ .mdhandler.php?asset=/$1.md [L]
RewriteRule ^zk$ - [R=404,L]
Expand Down
12 changes: 7 additions & 5 deletions api/Playlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ public static function fromRecord($rec, $flags) {
})->onSpin(function($entry) use(&$events, $relations, $flags) {
$spin = $entry->asArray();
$spin["type"] = "spin";
$spin["artist"] = PlaylistEntry::swapNames($spin["artist"]);
if($spin["tag"])
$spin["artist"] = PlaylistEntry::swapNames($spin["artist"]);
$spin["created"] = $entry->getCreatedTime();
if($spin["tag"] && $flags & self::LINKS_ALBUMS) {
$tag = $spin["tag"];
Expand Down Expand Up @@ -317,11 +318,11 @@ public function fetchRelationship(RequestInterface $request): ResponseInterface
unset($attrs["tag"]);
unset($attrs["id"]);
$a->merge($attrs);
$a->set("artist", PlaylistEntry::swapNames($entry->getArtist()));
$a->set("created", $entry->getCreatedTime());

$tag = $entry->getTag();
if($tag) {
$a->set("artist", PlaylistEntry::swapNames($entry->getArtist()));
if($flags && sizeof($albums = Engine::api(ILibrary::class)->search(ILibrary::ALBUM_KEY, 0, 1, $tag)))
$res = Albums::fromArray($albums, $flags)[0];
else
Expand Down Expand Up @@ -665,7 +666,7 @@ public function addRelatedResources(RequestInterface $request): ResponseInterfac
// don't allow modification of album info if tag is set
$entry->setTag($album->id());
if(!$albumrec[0]["iscoll"])
$entry->setArtist(PlaylistEntry::swapNames($albumrec[0]["artist"]));
$entry->setArtist($albumrec[0]["artist"]);
$entry->setAlbum($albumrec[0]["album"]);
$entry->setLabel($albumrec[0]["name"]);
}
Expand Down Expand Up @@ -717,7 +718,8 @@ public function addRelatedResources(RequestInterface $request): ResponseInterfac
$list['id'] = $key;
if($entry->isType(PlaylistEntry::TYPE_SPIN)) {
$spin = $entry->asArray();
$spin['artist'] = PlaylistEntry::swapNames($spin['artist']);
if($spin['tag'])
$spin['artist'] = PlaylistEntry::swapNames($spin['artist']);
} else
$spin = null;

Expand Down Expand Up @@ -790,7 +792,7 @@ public function replaceRelatedResources(RequestInterface $request): ResponseInte
// don't allow modification of album info if tag is set
$entry->setTag($album->id());
if(!$albumrec[0]["iscoll"])
$entry->setArtist(PlaylistEntry::swapNames($albumrec[0]["artist"]));
$entry->setArtist($albumrec[0]["artist"]);
$entry->setAlbum($albumrec[0]["album"]);
$entry->setLabel($albumrec[0]["name"]);
}
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
"react/datagram": "^1.5",
"react/http": "^1.2",
"ratchet/pawl": "^0.4.1",
"rocketman/pdf-label": "^1.6+rocketman.1",
"rocketman/pdf-label": "^1.6+rocketman.2",
"twig/twig": "^3.5.1",
"vstelmakh/url-highlight": "^3.0"
},
"suggest": {
"ext-intl": "Allows transliteration of Cyrillic and Greek to Latin"
}
}
23 changes: 14 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/controller_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'export' => ZK\Controllers\ExportPlaylist::class,
'afile' => ZK\Controllers\ExportAfile::class,
'opensearch' => ZK\Controllers\OpenSearch::class,
'artwork' => ZK\Controllers\ArtworkControl::class,
'cache' => ZK\Controllers\CacheControl::class,
'daily' => ZK\Controllers\RunDaily::class,
'print' => ZK\Controllers\PrintTags::class,
Expand Down
89 changes: 89 additions & 0 deletions controllers/ArtworkControl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
/**
* Zookeeper Online
*
* @author Jim Mason <[email protected]>
* @copyright Copyright (C) 1997-2023 Jim Mason <[email protected]>
* @link https://zookeeper.ibinx.com/
* @license GPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License,
* version 3, along with this program. If not, see
* http://www.gnu.org/licenses/
*
*/

namespace ZK\Controllers;

use ZK\Engine\Engine;
use ZK\Engine\IArtwork;
use ZK\Engine\IPlaylist;
use ZK\Engine\PlaylistEntry;
use ZK\Engine\PlaylistObserver;

class ArtworkControl implements IController {
protected $verbose = false;

protected function refreshList($playlist) {
$count = 0;
$imageApi = Engine::api(IArtwork::class);
Engine::api(IPlaylist::class)->getTracksWithObserver($playlist,
(new PlaylistObserver())->on('spin', function($entry) use($imageApi, &$count) {
if(!$entry->getTag() && $entry->getCreated()) {
$artist = $entry->getArtist();
if($this->verbose)
echo " deleting $artist\n";
$imageApi->deleteArtistArt($artist);
$count++;
}
})
);

if($count) {
echo "$count images queued for reload (please wait)\n";
PushServer::lazyLoadImages($playlist);
} else
echo "No artist artwork found. No change.\n";
}

public function processRequest() {
if(php_sapi_name() != "cli") {
http_response_code(400);
return;
}

// The heavy lifting is done by the push notification server.
// If it is not enabled, there is no point in proceeding.
if(!Engine::param('push_enabled', true)) {
echo "Push notification is disabled. No change.\n";
return;
}

$this->verbose = $_REQUEST["verbose"] ?? false;

switch($_REQUEST["action"] ?? "") {
case "reload":
if($tag = $_REQUEST["tag"] ?? null) {
echo "Album queued for reload (please wait)\n";
PushServer::lazyReloadAlbum($tag, $_REQUEST["master"] ?? 1, $_REQUEST["skip"] ?? 0);
break;
} else if($list = $_REQUEST["list"] ?? null) {
$this->refreshList($list);
break;
}
// fall through...
default:
echo "Usage: zk artwork:reload {tag|list}=id [master=0] [skip=0]\n";
break;
}
}
}
4 changes: 2 additions & 2 deletions controllers/ExportPlaylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function emitCSV() {
// emit the tracks
echo "Artist\tTrack\tAlbum\tTag\tLabel\tTimestamp\n";
$observer = (new PlaylistObserver())->onSpin(function($entry) {
echo $entry->getArtist()."\t".
echo ($entry->getTag() ? PlaylistEntry::swapNames($entry->getArtist()) : $entry->getArtist())."\t".
$entry->getTrack()."\t".
$entry->getAlbum()."\t".
$entry->getTag()."\t".
Expand Down Expand Up @@ -249,7 +249,7 @@ public function emitHTML() {
$break = true;
}
})->onSpin(function($entry) use(&$break) {
echo " <TR><TD ALIGN=LEFT VALIGN=TOP>".htmlentities(PlaylistEntry::swapNames($entry->getArtist())) . "</TD><TD ALIGN=LEFT VALIGN=TOP>" .
echo " <TR><TD ALIGN=LEFT VALIGN=TOP>".htmlentities($entry->getTag() ? PlaylistEntry::swapNames($entry->getArtist()) : $entry->getArtist()) . "</TD><TD ALIGN=LEFT VALIGN=TOP>" .
htmlentities($entry->getTrack()). "</TD><TD ALIGN=LEFT>" .
htmlentities($entry->getAlbum()). "<BR><FONT CLASS=\"sub\">" .
htmlentities($entry->getLabel()). "</FONT></TD><TD ALIGN=RIGHT VALIGN=TOP>";
Expand Down
Loading