public/lib/playlist.php
/*
    * @abstract Update the database information to move an album(s) from the playlist to the library
    * @param int/array $refCode The album's unique playlist number. May be a single RefCode or a list of RefCodes.
    */
@abstract Update the database information to move an album(s) from the playlist to the library
@param int/array $refCode The album's unique playlist number. May be a single RefCode or a list of RefCodes.
@abstract Update the database information to move an album ( s ) from the playlist to the library @param int / array $refCode The album ' s unique playlist number . May be a single RefCode or a list of RefCodes .
public function moveAlbumToLibrary($refCode) {
        if (!is_array($refCode))
            $refCode = [$refCode];
        if (sizeof($refCode) > 0) {
	    $playlistIds = [];
	    foreach ($refCode as $ref) {
		$stmt = $this->db->query("SELECT PlaylistId FROM playlist WHERE RefCode={$ref} ORDER BY Expire DESC LIMIT 1;");
		array_push($playlistIds, $stmt->fetch(\PDO::FETCH_ASSOC)['PlaylistId']);
	    }
            $refCodeList = "(" . implode(", ", $refCode) . ")";
	    $playlistIdList = "(" . implode(", ", $playlistIds) . ")";
            $this->db->query("UPDATE playlist SET Expire=NOW() WHERE PlaylistID IN " . $playlistIdList . ";");
            $this->db->query("UPDATE library SET playlist_flag='FALSE' WHERE RefCode IN " . $refCodeList . ";");
        }
	$notification = new \TPS\notification($_SESSION['CALLSIGN']);
	$notification->checkConvert(FALSE); 
    }
public function moveAlbumToLibrary ( $ refCode ) { if ( ! is_array ( $ refCode ) ) $ refCode = [ $ refCode ] ; if ( sizeof ( $ refCode ) > 0 ) { $ playlistIds = [ ] ; foreach ( $ refCode as $ ref ) { $ stmt = $ this -> db -> query ( " SELECT PlaylistId FROM playlist WHERE RefCode= { $ ref }  ORDER BY Expire DESC LIMIT 1; " ) ; array_push ( $ playlistIds , $ stmt -> fetch ( \ PDO :: FETCH_ASSOC ) [ 'PlaylistId' ] ) ; } $ refCodeList = " ( " . implode ( " ,  " , $ refCode ) . " ) " ; $ playlistIdList = " ( " . implode ( " ,  " , $ playlistIds ) . " ) " ; $ this -> db -> query ( " UPDATE playlist SET Expire=NOW() WHERE PlaylistID IN  " . $ playlistIdList . " ; " ) ; $ this -> db -> query ( " UPDATE library SET playlist_flag='FALSE' WHERE RefCode IN  " . $ refCodeList . " ; " ) ; } $ notification = new \ TPS \ notification ( $ _SESSION [ 'CALLSIGN' ] ) ; $ notification -> checkConvert ( FALSE ) ; }
@abstract Update the database information to move an album(s) from the playlist to the library
 @param int/array $refCode The album's unique playlist number.
@abstract Update the database information to move an album ( s ) from the playlist to the library @param int / array $refCode The album ' s unique playlist number .
// Don't notify management if the number of expired albums decreases