Skip to content

Commit ddcc2a0

Browse files
committed
fix(playlist): removal of cron via API
allows setting CRON as an empty string which is set to nil in the database
1 parent 4748dcd commit ddcc2a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/placeos-models/playlist.cr

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ module PlaceOS::Model
120120

121121
# ensure crons valid
122122
validate ->(this : Playlist) {
123-
return if (cron = this.play_cron).nil?
123+
if (cron = this.play_cron.presence).nil?
124+
this.play_cron = nil
125+
return
126+
end
127+
124128
begin
125129
CronParser.new(cron)
126130
rescue error

0 commit comments

Comments
 (0)