Skip to content

Commit 4b87382

Browse files
authored
Merge pull request #101 from dyphire/user_data
Prepare for shared-script-properties removal
2 parents 732c992 + ed615db commit 4b87382

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

scripts/SimpleBookmark.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ o.open_list_keybind = utils.parse_json(o.open_list_keybind)
290290
o.list_filter_jump_keybind = utils.parse_json(o.list_filter_jump_keybind)
291291
o.list_ignored_keybind = utils.parse_json(o.list_ignored_keybind)
292292

293-
utils.shared_script_property_set("simplebookmark-menu-open", "no")
293+
if utils.shared_script_property_set then
294+
utils.shared_script_property_set('simplebookmark-menu-open', 'no')
295+
end
296+
mp.set_property('user-data/simplebookmark/menu-open', 'no')
294297

295298
if string.lower(o.log_path) == '/:dir%mpvconf%' then
296299
o.log_path = mp.find_config_file('.')
@@ -1277,7 +1280,10 @@ function display_list(filter, sort, action)
12771280

12781281
if not search_active then get_page_properties(filter) else update_search_results('','') end
12791282
draw_list(osd_log_contents)
1280-
utils.shared_script_property_set("simplebookmark-menu-open", "yes")
1283+
if utils.shared_script_property_set then
1284+
utils.shared_script_property_set('simplebookmark-menu-open', 'yes')
1285+
end
1286+
mp.set_property('user-data/simplebookmark/menu-open', 'yes')
12811287
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'no', 'no_osd') end
12821288
list_drawn = true
12831289
if not search_active then get_list_keybinds() end
@@ -1958,7 +1964,10 @@ function unbind_list_keys()
19581964
end
19591965

19601966
function list_close_and_trash_collection()
1961-
utils.shared_script_property_set("simplebookmark-menu-open", "no")
1967+
if utils.shared_script_property_set then
1968+
utils.shared_script_property_set('simplebookmark-menu-open', 'no')
1969+
end
1970+
mp.set_property('user-data/simplebookmark/menu-open', 'no')
19621971
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'yes', 'no_osd') end
19631972
unbind_list_keys()
19641973
unbind_search_keys()

scripts/SimpleHistory.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ o.open_list_keybind = utils.parse_json(o.open_list_keybind)
254254
o.list_filter_jump_keybind = utils.parse_json(o.list_filter_jump_keybind)
255255
o.list_ignored_keybind = utils.parse_json(o.list_ignored_keybind)
256256

257-
utils.shared_script_property_set("simplehistory-menu-open", "no")
257+
if utils.shared_script_property_set then
258+
utils.shared_script_property_set('simplehistory-menu-open', 'no')
259+
end
260+
mp.set_property('user-data/simplehistory/menu-open', 'no')
258261

259262
if string.lower(o.log_path) == '/:dir%mpvconf%' then
260263
o.log_path = mp.find_config_file('.')
@@ -977,7 +980,10 @@ function display_list(filter, sort, action)
977980

978981
if not search_active then get_page_properties(filter) else update_search_results('','') end
979982
draw_list()
980-
utils.shared_script_property_set("simplehistory-menu-open", "yes")
983+
if utils.shared_script_property_set then
984+
utils.shared_script_property_set('simplehistory-menu-open', 'yes')
985+
end
986+
mp.set_property('user-data/simplehistory/menu-open', 'yes')
981987
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'no', 'no_osd') end --1.1.6# fix osc-idlescreen (value was yes for some reason)
982988
list_drawn = true
983989
if not search_active then get_list_keybinds() end
@@ -1640,7 +1646,10 @@ function unbind_list_keys()
16401646
end
16411647

16421648
function list_close_and_trash_collection()
1643-
utils.shared_script_property_set("simplehistory-menu-open", "no")
1649+
if utils.shared_script_property_set then
1650+
utils.shared_script_property_set('simplehistory-menu-open', 'no')
1651+
end
1652+
mp.set_property('user-data/simplehistory/menu-open', 'no')
16441653
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'yes', 'no_osd') end
16451654
unbind_list_keys()
16461655
unbind_search_keys()

scripts/SmartCopyPaste_II.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ o.open_list_keybind = utils.parse_json(o.open_list_keybind)
288288
o.list_filter_jump_keybind = utils.parse_json(o.list_filter_jump_keybind)
289289
o.list_ignored_keybind = utils.parse_json(o.list_ignored_keybind)
290290

291-
utils.shared_script_property_set("smartcopypaste-menu-open", "no")
291+
if utils.shared_script_property_set then
292+
utils.shared_script_property_set('smartcopypaste-menu-open', 'no')
293+
end
294+
mp.set_property('user-data/smartcopypaste/menu-open', 'no')
292295

293296
if string.lower(o.log_path) == '/:dir%mpvconf%' then
294297
o.log_path = mp.find_config_file('.')
@@ -1047,7 +1050,10 @@ function display_list(filter, sort, action)
10471050

10481051
if not search_active then get_page_properties(filter) else update_search_results('','') end
10491052
draw_list()
1050-
utils.shared_script_property_set("smartcopypaste-menu-open", "yes")
1053+
if utils.shared_script_property_set then
1054+
utils.shared_script_property_set('smartcopypaste-menu-open', 'yes')
1055+
end
1056+
mp.set_property('user-data/smartcopypaste/menu-open', 'yes')
10511057
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'no', 'no_osd') end
10521058
list_drawn = true
10531059
if not search_active then get_list_keybinds() end
@@ -1710,7 +1716,10 @@ function unbind_list_keys()
17101716
end
17111717

17121718
function list_close_and_trash_collection()
1713-
utils.shared_script_property_set("smartcopypaste-menu-open", "no")
1719+
if utils.shared_script_property_set then
1720+
utils.shared_script_property_set('smartcopypaste-menu-open', 'no')
1721+
end
1722+
mp.set_property('user-data/smartcopypaste/menu-open', 'no')
17141723
if o.toggle_idlescreen then mp.commandv('script-message', 'osc-idlescreen', 'yes', 'no_osd') end
17151724
unbind_list_keys()
17161725
unbind_search_keys()

0 commit comments

Comments
 (0)