cniw / mpv-discordRPC

Discord Rich Presence integration for mpv Media Player
MIT License
133 stars 10 forks source link

Recent mpv changes #7

Closed MrNiceforest closed 4 years ago

MrNiceforest commented 4 years ago

Hi,

with the recent changes in MPV regarding scripts, this stopped working with the following errors (tested with mpv-x86_64-20200202-git-77a74d9):

   cplayer: Cannot find main.* for any supported scripting backend in: C:/Program Files/MPV/scripts/mpv-discordRPC

mpv_discordRPC: Discord Rich Presence integration for mpv Media Player
mpv_discordRPC: Upstream: https://github.com/cniw/mpv-discordRPC
mpv_discordRPC: Version: 1.4.1

mpv_discordRPC:
mpv_discordRPC: stack traceback:
mpv_discordRPC:         C:/Program Files/MPV/scripts/mpv-discordRPC.lua:126: in function 'cb'
mpv_discordRPC:         mp.defaults:346: in function 'process_timers'
mpv_discordRPC:         mp.defaults:506: in function 'dispatch_events'
mpv_discordRPC:         mp.defaults:479: in function <mp.defaults:478>
mpv_discordRPC:         [C]: at 0x00d18430
mpv_discordRPC:         [C]: at 0x00d17b00
mpv_discordRPC: Lua error: C:/Program Files/MPV/scripts/mpv-discordRPC.lua:126: module 'mpv-discordRPC.catalogs' not found:
mpv_discordRPC:         no field package.preload['mpv-discordRPC.catalogs']
mpv_discordRPC:         no file '.\mpv-discordRPC\catalogs.lua'
mpv_discordRPC:         no file 'C:\Program Files\MPV\lua\mpv-discordRPC\catalogs.lua'
mpv_discordRPC:         no file 'C:\Program Files\MPV\lua\mpv-discordRPC\catalogs\init.lua'
mpv_discordRPC:         no file '.\mpv-discordRPC\catalogs.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\mpv-discordRPC\catalogs.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\loadall.dll'
mpv_discordRPC:         no file '.\mpv-discordRPC.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\mpv-discordRPC.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\loadall.dll'

This however can be easily fixed. The files from "scripts\mpv-discordRPC" just need to be placed into the directory "lua\mpv-discordRPC" (or as above, in any other of the named directories, but the "lua" ones seems the most elegant, however the "lua" directory needs to be created if not already present). Perhaps this can be considered with the installer script.

cniw commented 4 years ago

@MrNiceforest thank you for your notice. Yes this problem is easy, but your solution above does not solve it. I will fix it soon.

cniw commented 4 years ago

Fixed https://github.com/cniw/mpv-discordRPC/commit/c9f7443b8d13df0b80d0e329490bbd798f566390.