volumio / volumio-plugins

165 stars 750 forks source link

playback saved to local file? #119

Closed lachlan-00 closed 6 years ago

lachlan-00 commented 6 years ago

Hey, I want to cache my playback with at least just the filepath to a local text file.

Is that possible with a plugin?

lachlan-00 commented 6 years ago

i have taken the last-100 plugin and tried writing to the data folder using fs-extra.

problem is that it crashes the web interface until i disable it. does a system plugin have extra features over a user plugin?

volumio commented 6 years ago

No, you should check your code better. Let me see what you've done

lachlan-00 commented 6 years ago

I have the plugin creating the txt file on start so I'm nearly there. I just cut out the last 100 i didnt want, then added fs-extra lines.

Here is a zip from the cli https://cloud.lachlandewaard.org/index.php/s/ffM5PFqMJsjCeYc

volumio commented 6 years ago

You're doing it wrong. Use the plugin helper to create a new plugin: https://volumio.github.io/docs/Plugin_System/Writing_A_Plugin.html

lachlan-00 commented 6 years ago

Will do. I'm usually a python person but I'll sit down after work and sort this out.

lachlan-00 commented 6 years ago

cache_fm.zip

I give up. i've tried making separate functions and tried to work out how to stop the plugin reloading every time i start if but i can't work out what i'm doing.

the functions run but the web interface resets whenever i enable socket-io. I want to use sockets to get the playing song data but i've tried every existing plugin/get/push/etc and nothing works.

checkCacheruns and then it looks like it crashes at io.connection in checkPlayback.