Skip to content
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

Modernize method of saving show_info and app settings #11

Closed
identd113 opened this issue Jan 8, 2021 · 5 comments
Closed

Modernize method of saving show_info and app settings #11

identd113 opened this issue Jan 8, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@identd113
Copy link
Owner

We can use json helper to convert records to json, and vice versa. This would allow us to store all of our data in a flat json file, instead of just a flat unorganized text file. This has mahy subtasks, which I can detail later.

@identd113 identd113 added the enhancement New feature or request label Jan 8, 2021
@identd113
Copy link
Owner Author

identd113 commented Jan 14, 2021

jsonhelper is unable to make a JSON out of show_info. I will contact developer via twitter at @mousedownsoft

@identd113
Copy link
Owner Author

JSONHelper can be used after all.
The values must be a string, a boolean, or a number. This is not all we use the script.
If we can "dumb down" some of the values, such as date strings, and paths. This is my test:

`
use AppleScript version "2.4"
use scripting additions
use application "JSON Helper"
set xlist to {}

set x to {show_title:"Happy_Holidays_America", show_time:16, show_length:60, show_air_date:Sunday, show_transcode:"missingvalue", show_temp_dir:"alias Backups:", show_dir:"alias Backups:", show_channel:5.1, show_active:true, show_id:"221fbe1126389e6af35f405aa681cf19", show_recording:false, show_last:"date Sunday, December 13, 2020 at 4:04:54 PM", show_next:"date Sunday, December 13, 2020 at 4:00:00 PM", show_end:"date Sunday, December 13, 2020 at 5:00:00 PM", notify_upnext_time:missing value, notify_recording_time:missing value, hdhr_record:"XX105404BE", show_is_series:false}
set end of xlist to x
set end of xlist to x
log (make JSON from xlist)
`

@identd113
Copy link
Owner Author

The schema for the save file deserves a good thinking out.
Ideally, we would have some separation between the tuner devices, and the shows they are recording. Since that would require a decent amount of work, and frankly, since this is just me yelling into the forest, I do not see much point of that kind of time commitment.
ideal hierarchy as is:

data{shows:show_info, hdhr_devices:HDHR_DEVICE_LIST, settings:misc_settings}

@identd113
Copy link
Owner Author

`use AppleScript version "2.4"
use scripting additions
use application "JSON Helper"

set x to make JSON from {atest:"123", atest2:123, atest3:((current date) as text), atest4:true, atest5:POSIX path of (path to me), atest6:missing value}

set y to read JSON from x

log ((date (atest3 of y)) - (current date))
`

@identd113
Copy link
Owner Author

identd113 commented Aug 10, 2021

jsonhelper fails to convert HFS paths, and dates into proper applescript, and then fails with a blank response.
If these items can be stored as text, then I suppose we could build us a new saving system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant