INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Problems setting Database field value during Smartlist processing  (Read 438 times)

rbmjr

  • World Citizen
  • ***
  • Posts: 124

I have created a database field called "Smartlist" and want to fill that database field with a value that indicates what Smartlist the database record was selected by.

I have also set the "After playback expression: setfield(smartlist,)

My first attempt at setting the "Smartlist" field in the database record was to add an "Expression Column". The Expression Column contains the following command: "SetField(Smartlist,DI 2020)" for a Smarlist that selects database records based upon the date the record was Imported.

I went on to duplicate that approach in other Smartlists using the command: "SetField(Smartlist,LP 2020) for database records based upon the date the record was Last Played, and using the command: "SetField(Smartlist,NP 2020) for database records based upon the Number of Plays. Example attached. And finally, I duplicated this approach for a Smartlist that selected database records at Random using the command: SetField(Smartlist,RA 2020) and it too appeared to work as intended. Example attached.

Next, I created a Combo Smartlist that included the four Smartlist playlists. The ones with; Setfield(Smartlist,DI 2020), Setfield(Smartlist,LP 2020), Setfield(Smartlist,NP 2020), and Setfield(Smartlist,RA 2020). Example attached. When the Combo Smartlist executes, the database Smartlist field shows records with the values "DI 2020" Date Imported, "LP 2020" Last Played and "NP 2020" Number of Plays, however the records selected by the Random Smartlist show up with blank values. For some reason when the Combo Smartlist processes the Random Smartlist the Expression column does not get processed, or the Expression column gets processed after records were returned to the Combo Smartlist, or the Combo Smartlist returns a different random set of records.

Help please, is this a bug or am I doing something wrong? I think it would be awesomel if there was an "Add Modifier" option in Smartlists that would allow you to execute commands like "Setfield". Is that possible?
Logged

rbmjr

  • World Citizen
  • ***
  • Posts: 124
Re: Problems setting Database field value during Smartlist processing
« Reply #1 on: October 04, 2022, 10:05:16 am »

Is this the correct forum to post issues with MC29?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Problems setting Database field value during Smartlist processing
« Reply #2 on: October 04, 2022, 12:11:19 pm »

It is, but what you are doing is quite difficult to follow.

The only thing that jumps out at me as being potentially wrong is your "After Playback Expression", SetField(smartlist,), is missing any instruction as to what to set, so, isn't that clearing the field whenever you finish playing something?

Quote
I have created a database field called "Smartlist" and want to fill that database field with a value that indicates what Smartlist the database record was selected by.
I don't understand this. Sorry :(

-marko

rbmjr

  • World Citizen
  • ***
  • Posts: 124
Re: Problems setting Database field value during Smartlist processing
« Reply #3 on: October 04, 2022, 03:00:35 pm »

Yes it clears the database field after playback.

It appears that there is a problem with the sequence of events in smartlist processing when the smartlist is called from another smartlist.

It's as if...
(1) the call never executes the Expression command before returning the selected records to the calling smartlist, or
(2) it executes the Expression command but returns a different random set of records to the calling smartlist.

For smartlists that select database records based upon values that don't change until the song has been played (Number of plays, Last Played) or that never change like (Date Imported) the called smartlist returns the same records time after time and they include the executed Expression commands output.

It's only when I call a smartlist that selects a random set of records as in...
Rules
(1) Media type is Audio
(2) Year is 2020-2029
(3) Rating is 5 stars
Modify Results
(1) Shuffle
(2) Limit the selection to x songs
(3) Sequence the selection
...that the Expression command does not execute, or has executed for a different set of randomly selected records.

BTW thanks for taking a look in to this. Please let me know how else I can help?
Logged
Pages: [1]   Go Up