-
Notifications
You must be signed in to change notification settings - Fork 9
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
Custom record_audio value should always be present in show JSON #877
Comments
@seankwilliams If I'm understanding correctly that this is a missing attribute on the back end, my initial thoughts here are to change two files. In |
@kmid5280 Please feel free to give that a try and test things out! I am not sure the exact conditions that end up with |
@seankwilliams This looks like a two-part issue, one for posting and one for updating existing shows with a new This is a custom value, which appears to be imported from We could possibly add a conditional to the Wondering if we should set a default value for the checkbox in I'm having some trouble doing this with custom fields. Since by default, it is not creating a |
@seankwilliams Also, I notice in some cases that when set, the |
@kmid5280 For purposes of this, let's not worry about ones that are set to 1 instead of true. Ideally they'd all be consistent (so if you see a way to do that, go for it!), but for the scope of this issue, the main thing to address is when the custom.record_audio value is not set because that's breaking a script that KGNU has set up (outside of Comrad) I think your testing is on the right track but I do not have any suggestions off the top of my head for how to address. We'd have to review (1) the implementation of custom attributes in the code base (this is specific to Comrad), and (2) Redux Form and how it handles checkboxes that are not selected. It's also possible that the solution could be implemented on the back-end if necessary when creating & updating a show. |
@seankwilliams I'm learning that Mongoose will not automatically set a value to an attribute listed in the schema if the attribute is empty. Meaning, it will not create a My thought is, as a workaround, we could add the following conditionals in
|
@kmid5280 Good research, and I think this fix makes a lot of sense! In a perfect world, everything for the custom fields would be totally powered by the settings ( However, let's not let the perfect be the enemy of the good here, because your solution will work, and it solves a problem at KGNU where one of their scripts is crashing when this attribute is not present. Let's implement what you have! I can run a custom Mongo query to set this to false where it isn't arleady set in the database. |
@seankwilliams Thanks. Just to clarify, will this solution by itself be enough to tackle updating the existing entries as well? |
@kmid5280 I believe that will only affect the existing entries if the show is saved after your changes are in place. |
@seankwilliams Right now the changes are implemented in the |
@kmid5280 No need to implement something for existing shows! I can run a Mongo query for that. There really aren't many master show records, so even if it's hard to write a bulk query to do that, I could even update them one by one in 10 or 15 minutes. |
I am guessing I can write a bulk query for it no problem -- but I'm not as experienced querying Mongo as I am with SQL, so sometimes I get tripped up on it. |
There is a custom.record_audio value for shows. Sometimes, this isn't in the data at all. It should always be present, and should default to false.
George from KGNU says:
ahh - fyi - it looks like TUCRadio was missing the value - last Sunday (11/5/23) at noon, it alternates weeks with Tributaries.
Also missing this is: RMCRRegionalRoundup (Mondays)
The text was updated successfully, but these errors were encountered: