Skip to Content
It is currently October 15th, 2019, 9:37 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: September 5th, 2018, 2:32 pm 
Offline
Junior User
Junior User

Joined: November 12th, 2012, 10:35 pm
Posts: 35
For some reason I get a query error: Table is read only error when running the twofer tuesday PAL.

I opened the SQL workbench, and I appear to have granted full access rights to root.

I'm sure the fix is simple, but so am I.

Can anyone shed light on what I am missing?

I still run v4.9.8 in a Windows7 environment because I can not afford the new version.
Running MySQL Workbench 6.0 CE.

Any help would be greatly appreciated, and I would love to use this great PAL.

_________________
Subscribe to the SIGNAL 7 DEEP CUTS CLASSIC ROCK PODCAST at: http://signal7.podomatic.com or at the iTunes Store: https://itunes.apple.com/us/podcast/...ic/id580050123


Top
 Profile  
Reply with quote  
PostPosted: September 5th, 2018, 2:35 pm 
Offline
Junior User
Junior User

Joined: November 12th, 2012, 10:35 pm
Posts: 35
I'm so sorry for the duplicate posts, I don't know why.

_________________
Subscribe to the SIGNAL 7 DEEP CUTS CLASSIC ROCK PODCAST at: http://signal7.podomatic.com or at the iTunes Store: https://itunes.apple.com/us/podcast/...ic/id580050123


Top
 Profile  
Reply with quote  
PostPosted: September 7th, 2018, 9:10 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10449
Location: Denver, CO
You are going to have narrow it down to WHICH line in the TWOFER script is giving the error that would help. Also what version of MYSQL.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: September 7th, 2018, 9:56 am 
Offline
Junior User
Junior User

Joined: November 12th, 2012, 10:35 pm
Posts: 35
DJ Cassio wrote:
You are going to have narrow it down to WHICH line in the TWOFER script is giving the error that would help. Also what version of MYSQL.


it happens here:

Code:
  Case input of
          'get_artist' : result := 'select sl.artist, count( sl.title ) as song_count from songlist sl, categorylist cl, category c where sl.date_artist_played < date_sub( now(), interval :artist_time minute ) and sl.date_album_played < date_sub( now(), interval :album_time minute ) and sl.date_title_played < date_sub( now(), interval :title_time minute ) and sl.date_played < date_sub( now(), interval :track_time minute ) and sl.id = cl.songid and cl.categoryid = c.id and c.name = :category group by sl.artist having song_count > :min_songs order by rand() limit 1';
           'get_songs' : result := 'select distinct title, filename from songlist where date_artist_played < date_sub( now(), interval :artist_time minute ) and date_album_played < date_sub( now(), interval :album_time minute ) and date_title_played < date_sub( now(), interval :title_time minute ) and date_played < date_sub( now(), interval :track_time minute ) and artist in ( :artist ) order by rand() limit :xfers';


and I am using MySQL version 5.7.

_________________
Subscribe to the SIGNAL 7 DEEP CUTS CLASSIC ROCK PODCAST at: http://signal7.podomatic.com or at the iTunes Store: https://itunes.apple.com/us/podcast/...ic/id580050123


Top
 Profile  
Reply with quote  
PostPosted: September 7th, 2018, 2:33 pm 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4732
Location: Los Angeles - A Little West Of Nashville
That code looks nothing like the code in Festerhead's 2-fer script. Where did you get the script from and who wrote it ?

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: September 8th, 2018, 10:03 pm 
Offline
Junior User
Junior User

Joined: November 12th, 2012, 10:35 pm
Posts: 35
Got it on the internet: I thought it was the old knowledgebase:

Code:
{
  ********************************************************
  *
  * Copyright (C) Steve Kunitzer (FesterHead)
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * 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
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  ********************************************************

  -- PAL to load xFERS into the system (e.g. twofers, threefers, ...)
  -- Supports only MySQL.  See SQL statements at end of PAL for the curious.

  Schedule to start using the Event Scheduler.
}

// Put your own scheduling here.
// Example is to:
//   * continously run once the queue reaches one song
//   * stop running when the day is not Tuesday
// ********* Begin schedule *******************

PAL.Loop := true;
Pal.WaitForQueue( 3 );

if DayOfWeek( Date ) <> Wednesday then
  begin
    PAL.Loop := false;
  end;

// ********** End schedule ********************

// What is the name of the category from which potential condidates are selected?
// In general, supply a category that you use for general rotation such as "Tracks" or "Music (All)"
// Can be useful if you just want xFERS from specific categories (SAM or user managed) to do themed shows.
var category_select : String = 'POWER';

// How many xFERS to do?  Twofers = 2, Threefers = 3, ...
var num_xfers : Integer = 2;

// Minimum number of available songs to be considered for xFERS.
// Takes into account the current playlist rule values to get an available song selection count
var min_songs : Integer = 2;

// Where in the queue to insert the songs?  Use ipTop or ipBottom.
var queue_position : Integer = ipBottom;

// Run in evaluation mode?  If true then nothing will be added to the queue.
var eval_mode : Boolean = false;

// *******************************************
// * STOP! EDIT BELOW HERE AT YOUR OWN RISK! *
// *******************************************

if( eval_mode ) then
  begin
    WriteLn( 'Running in EVALUATION MODE' );
    WriteLn( 'Will not add anything to the queue' );
    WriteLn( '' );
  end;

Function lookup_sql( input: String ): String; forward;

var the_artist : TDataSet = Query( lookup_sql( 'get_artist' ), [ PlaylistRules.minArtistTime, PlaylistRules.minAlbumTime, PlaylistRules.minTitleTime, PlaylistRules.minTrackTime, category_select, min_songs ], false );

if ( the_artist.EOF ) then
  begin
    WriteLn( '***ERROR***' );
    WriteLn( 'Did not select an artist' );
    Writeln( 'Consider turning down the playlist rules requirements or the number of minimum songs needed' );
    WriteLn( '***ERROR***' );
  end
else
  begin
    var the_songs : TDataSet = Query( lookup_sql( 'get_songs' ), [ PlaylistRules.minArtistTime, PlaylistRules.minAlbumTime, PlaylistRules.minTitleTime, PlaylistRules.minTrackTime, the_artist['artist'], num_xfers ], true );

    WriteLn( 'Selected: ' + the_artist['artist'] );
    WriteLn( '' );

    // sanity check the song selection count
    // this is lame; not the most efficient; possibly get from the SQL?
    var counter : Integer = 0;
    the_songs.First;
    while not the_songs.EOF do
      begin
        counter := counter +1;
        the_songs.Next;
      end;

    if( counter < num_xfers ) then
      begin
        WriteLn( '***ERROR***' );
        WriteLn( 'Did not meet xFER requirement: ' + IntToStr( num_xfers ) );
        Writeln( 'Only found: ' + IntToStr( counter ) );
        WriteLn( '***ERROR***' );
      end
    else
      begin
        the_songs.First;
        while not the_songs.EOF do
          begin
            WriteLn( 'Title: ' + the_songs['title'] );
            if( not eval_mode ) then
              begin
                Queue.AddFile( the_songs['filename'], queue_position );
              end;
            the_songs.Next;
          end;
      end;

   the_songs.Free;
  end;

the_artist.Free;

PAL.UnlockExecution;

Function lookup_sql( input: String ): String;
  begin
    result := 'ERROR!  No SQL statement match for: ' + input;
    Case input of
          'get_artist' : result := 'select sl.artist, count( sl.title ) as song_count from songlist sl, categorylist cl, category c where sl.date_artist_played < date_sub( now(), interval :artist_time minute ) and sl.date_album_played < date_sub( now(), interval :album_time minute ) and sl.date_title_played < date_sub( now(), interval :title_time minute ) and sl.date_played < date_sub( now(), interval :track_time minute ) and sl.id = cl.songid and cl.categoryid = c.id and c.name = :category group by sl.artist having song_count > :min_songs order by rand() limit 1';
           'get_songs' : result := 'select distinct title, filename from songlist where date_artist_played < date_sub( now(), interval :artist_time minute ) and date_album_played < date_sub( now(), interval :album_time minute ) and date_title_played < date_sub( now(), interval :title_time minute ) and date_played < date_sub( now(), interval :track_time minute ) and artist in ( :artist ) order by rand() limit :xfers';
    end;
  end;

_________________
Subscribe to the SIGNAL 7 DEEP CUTS CLASSIC ROCK PODCAST at: http://signal7.podomatic.com or at the iTunes Store: https://itunes.apple.com/us/podcast/...ic/id580050123


Top
 Profile  
Reply with quote  
PostPosted: September 10th, 2018, 9:46 am 
Offline
Junior User
Junior User

Joined: November 12th, 2012, 10:35 pm
Posts: 35
[quote="Gman"]Got it on the internet: I thought it was the old knowledgebase:

http://support.spacialaudio.com/wiki/Tw ... on_2fer%29

_________________
Subscribe to the SIGNAL 7 DEEP CUTS CLASSIC ROCK PODCAST at: http://signal7.podomatic.com or at the iTunes Store: https://itunes.apple.com/us/podcast/...ic/id580050123


Top
 Profile  
Reply with quote  
PostPosted: September 10th, 2018, 12:27 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7878
Location: Aachen (Germany)
Looks exactly like the one I copied from his GCode account.
Probably just a confusion because you only posted the last few lines of the xfers script.

You should look into the MySQL changelogs of the last few versions and check if they changed any of the functions for time stuff lately.

Though, table read only sounds like a crashed InnoDB (transaction safe storage engine of MySQL) table to me.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group