Commit graph

955 commits

Author SHA1 Message Date
Fabio Manganiello
497d7770c6 Better way to group by media path 2019-02-17 17:16:25 +01:00
Fabio Manganiello
d03d69e6c0 Forgot an equal sign 2019-02-17 16:31:04 +01:00
Fabio Manganiello
2213455eff Fixed setup.py error on filter use as a keyword 2019-02-17 16:30:43 +01:00
Fabio Manganiello
a21a11d499 Only proceed with subtitles loading when the list of subs is not empty 2019-02-17 16:29:39 +01:00
Fabio Manganiello
4076cd3518 Sync removed directories in the media index 2019-02-17 16:04:46 +01:00
Fabio Manganiello
b204d477ac Added LocalMediaSearcher class to index local files and provide faster results to media.search when the index is available 2019-02-17 02:37:23 +01:00
Fabio Manganiello
7d1c9275f5 Make it 10 seconds when it comes to poll time 2019-02-16 20:21:04 +01:00
Fabio Manganiello
55f1a33d90 Keep a sleep between polls to the Snapcast servers 2019-02-16 20:17:15 +01:00
Fabio Manganiello
2d2db499be Running recording in a separate thread so it doesn't block the receiving backend and added playback/recording start/pause/stop events 2019-02-15 19:23:01 +01:00
Fabio Manganiello
f8e5515640 Make a copy of the procedure arguments before expanding the values from the context, or we'll permanently overwrite the procedure arguments with expanded values 2019-02-15 11:45:16 +01:00
Fabio Manganiello
1103e417e1 Managing optional arguments properly on _exec 2019-02-13 23:50:40 +01:00
Fabio Manganiello
6ac62b0161 Reset the time-seek indicator also on the web panel 2019-02-13 18:01:56 +01:00
Fabio Manganiello
4503eb31ed Clear track elapsed time display on stop event 2019-02-13 17:53:57 +01:00
Fabio Manganiello
a287a10bcc Propagate a MusicStopEvent upon playback stop even when the context of the current track is not available 2019-02-13 17:38:58 +01:00
Fabio Manganiello
32cdab5530 Always handle at least one retry on mpd plugin _exec method, the TCP connection to a mopidy server can really be shaky 2019-02-13 17:35:18 +01:00
Fabio Manganiello
7c817ba0c6 Position is expressed in milliseconds on mopidy websocket, convert to seconds 2019-02-13 17:25:56 +01:00
Fabio Manganiello
27e4ea5b5b Support for both enabled and disabled flags on plugin level 2019-02-13 15:14:35 +01:00
Fabio Manganiello
0a81b43f1d startStreaming should always return a map 2019-02-13 10:15:18 +01:00
Fabio Manganiello
8227427834 webtorrent timeout 20 -> 120 seconds 2019-02-13 09:46:51 +01:00
Fabio Manganiello
09f5c92541 Passing url from the promise in the right way 2019-02-13 09:38:40 +01:00
Fabio Manganiello
34e2dffe99 Catching music stop events both on track_playback_ended and playback_state_changed 2019-02-13 00:58:40 +01:00
Fabio Manganiello
8a9c868f77 Bringing more consistency in music.mpd.js regardless of the backend 2019-02-13 00:50:58 +01:00
Fabio Manganiello
0697598a86 Fixed music.js widget as well for the new mopidy backend 2019-02-13 00:32:14 +01:00
Fabio Manganiello
3190d3c6c8 Fixing music.mpd.js both for mpd and mopidy backends 2019-02-13 00:27:36 +01:00
Fabio Manganiello
f0f6d43990 Using the right naming for length and elapsed variables 2019-02-12 23:59:13 +01:00
Fabio Manganiello
71c6ba2d34 More compatibility between TCP-based mpd and websocket-based mopidy backends when it comes to how the track time is reported 2019-02-12 23:48:18 +01:00
Fabio Manganiello
77a76370a5 Returning flat representation for artist and renamed 'name' attribute for consistency with the mpd backend 2019-02-12 23:24:16 +01:00
Fabio Manganiello
1c4edf93bf Another typo 2019-02-12 23:19:36 +01:00
Fabio Manganiello
97855b1535 state might not always be provided in a music event 2019-02-12 23:11:37 +01:00
Fabio Manganiello
18d2c51b4e Forgot an enumerate 2019-02-12 23:08:48 +01:00
Fabio Manganiello
e5c169a549 on_message requires two arguments 2019-02-12 23:00:16 +01:00
Fabio Manganiello
6024eddd2d on_open requires ws as a parameter 2019-02-12 22:58:22 +01:00
Fabio Manganiello
c18515bd3c Few more fixes on mopidy backend 2019-02-12 22:57:09 +01:00
Fabio Manganiello
ee3df8fe8c Switched mopidy backend from websockets to websocket-client 2019-02-12 22:52:29 +01:00
Fabio Manganiello
b555777cc8 Use another event loop for the synchronous websocket communication method 2019-02-12 20:49:10 +01:00
Fabio Manganiello
73d7e9a3ef Fixes on mopidy backend 2019-02-12 20:45:40 +01:00
Fabio Manganiello
148d25f1cb Added mopidy backend functionalities 2019-02-12 20:34:17 +01:00
Fabio Manganiello
7b99842225 Added draft for mopidy backend over websocket 2019-02-12 17:29:24 +01:00
Fabio Manganiello
f68efc0d68 Attempt to support subtitles on Chromecast media too 2019-02-12 11:13:19 +01:00
Fabio Manganiello
5cbd0fdfe7 Added support for VTT subtitles and subtitles toggling both in local and browser media players 2019-02-12 01:30:55 +01:00
Fabio Manganiello
41c34b4bc5 Attempt to support subtitle tracks in web player 2019-02-11 18:46:25 +01:00
Fabio Manganiello
34f0264d5e Subtitles support
- Added support for local and OpenSubtitles media subs
- Added management of media events in web panel
2019-02-11 00:55:20 +01:00
Fabio Manganiello
630850ee9a Reset the connection to a Snapcast server if it starts failing 2019-02-10 11:08:04 +01:00
Fabio Manganiello
cd49f22d5c Introduced floating panel with options on element click instead of the double-click-to-play logic on media elements 2019-02-09 01:53:17 +01:00
Fabio Manganiello
434bc8a5eb Reset bridge connection upon failure 2019-02-08 19:59:25 +01:00
Fabio Manganiello
e2b0bf8462 More consistent management of media devices icons and added devices refresh button 2019-02-08 19:48:18 +01:00
Fabio Manganiello
b3f2974c4c Support for streaming media to browser 2019-02-08 00:43:43 +01:00
Fabio Manganiello
9ec3365413 Support for media streaming over internal HTTP server
Dropped the additional node.js dependency of localstream and relied
instead on a built-in solution to stream files
2019-02-07 14:27:14 +01:00
Fabio Manganiello
077bb0686b Don't break if no data is received from the Snapcast server 2019-02-07 09:05:27 +01:00
Fabio Manganiello
affaee6ab7 Forgot to override the default port when specified in media.start_streaming 2019-02-06 17:49:20 +01:00
Fabio Manganiello
86dc7f240a typo 2019-02-06 15:15:10 +01:00
Fabio Manganiello
880a394d74 Synchronize with the streaming process to make sure that we start playing only when the streaming service is ready 2019-02-06 15:12:55 +01:00
Fabio Manganiello
97d2e734ee Moved import magic statement to the get_mime_type function so Travis won't break 2019-02-06 13:22:58 +01:00
Fabio Manganiello
10e45123c4 Fixed localstream executable 2019-02-06 13:17:03 +01:00
Fabio Manganiello
687e9e32f9 Forgot an import os line 2019-02-06 11:55:21 +01:00
Fabio Manganiello
6713ce0f03 Implemented support for casting local media through the localstream script 2019-02-06 11:51:44 +01:00
Fabio Manganiello
d15b21ddfa Added support for remote cast on the web media panel 2019-02-06 09:47:00 +01:00
Fabio Manganiello
8a75979f72 Expose output_dir and media_file on TorrentCompletedDownloadEvent 2019-02-05 17:18:55 +01:00
Fabio Manganiello
f4dd4e0eb5 typo 2019-02-05 17:09:40 +01:00
Fabio Manganiello
8c8e913242 Don't pass duplicate arguments from download to play 2019-02-05 16:34:48 +01:00
Fabio Manganiello
ba48e52fb1 Update self.chromecasts on each get_chromecasts() call 2019-01-20 15:16:16 +01:00
Fabio Manganiello
3c0ed443a2 Support for download-only option in webtorrent plugin 2019-01-20 15:10:14 +01:00
Fabio Manganiello
d297b5cc42 Trying to make a more resiliant assistant error handling 2019-02-05 11:59:04 +01:00
Fabio Manganiello
caa48ad056 Better error handling on the assistant 2019-02-05 11:26:03 +01:00
Fabio Manganiello
96ee21dc0e More consistent naming for Kodi and Chromecast media methods 2019-02-05 11:02:31 +01:00
Fabio Manganiello
e2dbdcd66a Parsing the right state attributes out of the Chromecast status 2019-02-05 10:02:27 +01:00
Fabio Manganiello
9add8890cd Support for complete Chromecasts status 2019-02-05 09:49:50 +01:00
Fabio Manganiello
dc2a686d23 Support for casting torrents to Chromecast 2019-02-05 02:30:20 +01:00
Fabio Manganiello
3798414f22 Wait for the media file to be ready before failing 2019-02-05 00:52:14 +01:00
Fabio Manganiello
52d0ba442b Refactored webtorrent plugin and synchronization with the player
The WebTorrent plugin now uses the `download -o <download_dir> -p <port>` options.
Improved interaction both with the webtorrent executable and the player
executable, and triggering the right events upon state changes, as well
as free support for torrent streaming through the webtorrent executable.
2019-02-05 00:15:36 +01:00
Fabio Manganiello
9506813dc2 Only propagate a MediaStopEvent when the awaited player actually stops 2019-02-04 09:27:12 +01:00
Fabio Manganiello
05abc86b90 Handling webtorrent instance stop from mplayer interface 2019-02-04 01:55:14 +01:00
Fabio Manganiello
286eb431f0 Refactored torrent module 2019-02-04 01:01:39 +01:00
Fabio Manganiello
a4f80d4622 Added media.webtorrent plugin 2019-02-03 17:43:30 +01:00
Fabio Manganiello
4b7730d4cf Added status method to mplayer plugin 2019-02-02 17:55:29 +01:00
Fabio Manganiello
9ebb265458 Only copy the environment to the mplayer executable if it's set, and don't copy the whole environment from platypush 2019-02-02 17:32:56 +01:00
Fabio Manganiello
c18650c964 quit method implemented as part of the media interface 2019-02-02 17:12:22 +01:00
Fabio Manganiello
ed4b7e1da9 mplayer step_property volume doesn't really work as intended 2019-02-02 16:36:47 +01:00
Fabio Manganiello
3a5d7c7cba MPlayer has a quite weird way of handling the volume 2019-02-02 16:28:55 +01:00
Fabio Manganiello
535c4bbc17 Added set_volume action to mplayer plugin 2019-02-02 16:11:31 +01:00
Fabio Manganiello
d0a288b423 Don't start the mplayer pipe with shell=True 2019-02-02 16:06:56 +01:00
Fabio Manganiello
7068530eb0 Strip the file:// part out of the resource name 2019-02-02 15:58:18 +01:00
Fabio Manganiello
36725f7136 typo 2019-02-02 15:54:44 +01:00
Fabio Manganiello
1713c0c940 Propagate enviornment variables to the player executable 2019-02-02 15:51:12 +01:00
Fabio Manganiello
63b423cf75 Refactored mplayer and omxplayer under the same media player 2019-02-02 00:06:28 +01:00
Fabio Manganiello
56b6e6a899 More optimized check against supported extensions 2019-01-20 10:01:07 +01:00
Fabio Manganiello
297d1114e7 Implemented generic media plugin and made MPlayer extend it (TODO: omxplayer and vlc) 2019-01-20 08:50:05 +01:00
Fabio Manganiello
d59044fa2d Added MPlayer plugin 2019-02-01 09:34:50 +01:00
Fabio Manganiello
2d6dfc86ac typo 2019-01-30 10:04:42 +01:00
Fabio Manganiello
2956a9ca63 Restart the assistant connection on error 2019-01-30 09:21:35 +01:00
Fabio Manganiello
05a1713b92 Make sure that extra arguments on the Spotify URI are discarded during the URI parse 2019-01-30 09:08:29 +01:00
Fabio Manganiello
ee0040fba6 More robust Spotify URI parsing that discards optional arguments (e.g. si=) passed to the URL 2019-01-30 09:04:18 +01:00
Fabio Manganiello
7a80cd08ce Handling dashboards widget configuration as a list instead of a hash to preserve the order of the widgets 2019-01-28 23:14:12 +01:00
Fabio Manganiello
339d1eb132 Better way to log the impacted plugin and action in case of uncaught exceptions in requests 2019-01-27 17:51:07 +01:00
Fabio Manganiello
947fc8f583 Better handling of Hue bridge first-time pairing 2019-01-27 17:26:15 +01:00
Fabio Manganiello
235ddc6c2d More robust logging system and options to disable stdout/stderr logging capture 2019-01-27 00:53:30 +01:00
Fabio Manganiello
e1920700ec Handle backend stop/disconnection on MQTT 2019-01-18 04:10:27 +01:00
Fabio Manganiello
1f4efbb427 Better handling for the lights blink animation for groups 2019-01-20 00:42:07 +01:00
Fabio Manganiello
d1b9fef740 Passing socket_timeout=transition_seconds attribute to _get_redis 2019-01-20 00:36:07 +01:00
Fabio Manganiello
c7decd81f2 Lazy inizialitation for the Redis object in light.hue to prevent race conditions on start/stop animation 2019-01-20 00:29:58 +01:00
Fabio Manganiello
122978c6f0 Support for extra args/kwargs passed to light.hue actions 2019-01-19 23:23:58 +01:00
Fabio Manganiello
2b38f1b03f Added alarm, timer and error event handlers on assistant backend 2019-01-19 01:55:32 +01:00
Fabio Manganiello
03bdf5c547 Implemented get_timeout/get_timeouts/get_interval/get_intervals util methods 2019-01-14 20:44:40 +01:00
Fabio Manganiello
0e6f8bbb0b typo 2019-01-14 19:54:59 +01:00
Fabio Manganiello
ca24243449 As python-mpd2 doesn't seem to be quite thread-safe, the mpd plugin entry-point has now got a reentrant lock 2019-01-14 19:52:54 +01:00
Fabio Manganiello
d96ffe4d9f typo 2019-01-13 23:47:35 +01:00
Fabio Manganiello
f38b2db273 Fixed interaction with modal dialogs to prevent browser race conditions when touchscreen events are involved 2019-01-13 23:45:03 +01:00
Fabio Manganiello
740063c23b Clear the timeout handler from the map once the execution is terminated 2019-01-13 22:58:18 +01:00
Fabio Manganiello
2d8b2ba55a Removed pp- prefix from the name of the spawned processes and threads 2019-01-13 20:41:15 +01:00
Fabio Manganiello
e5d1dd3791 Version bump 0.9.4 -> 0.9.5 2019-01-13 20:12:12 +01:00
Fabio Manganiello
db4e68e247 Do exception logging at Request level and discard duplicate exception messages between retries 2019-01-13 20:09:25 +01:00
Fabio Manganiello
8ea0519954 Support for set/clear timeout/interval utils actions and error handling refactor
- Added set/cler timeout/interval actions in the utils plugin to
dynamically set or stop timed actions from your custom logic

- Actions error handling refactoring. If a Response is processed with
some errors, then just log the error and return it to the caller,
without raising an exception. If instead the action execution raised an
uncaught exception, then handle the retries properly and return errors
as a list with the output from all the retries, without being too
verbose with the returning and logging the whole stack trace multiple
times.
2019-01-13 19:29:08 +01:00
Fabio Manganiello
2a52eb770b Renamed value variable in expand_value_from_context to _value to prevent common name clashes with attributes named 'value' in the context 2019-01-12 22:43:01 +01:00
Fabio Manganiello
3587fa7cb4 Force music.mpd plugin reload when the mpd backend fails to get the state 2019-01-12 02:15:24 +01:00
Fabio Manganiello
bb8a21ed13 Revert "Sort Adafruit IO received data by timestamp"
This reverts commit 2739dda266.
2019-01-12 02:08:04 +01:00
Fabio Manganiello
2739dda266 Sort Adafruit IO received data by timestamp 2019-01-12 02:06:38 +01:00
Fabio Manganiello
78d44364cf Casting data to number whenever possible on FeedUpdateEvent as well 2019-01-12 01:58:35 +01:00
Fabio Manganiello
d63ad91b2a Implemented receive_next and receive_previous wrappers in Adafruit IO and rationalized returned types 2019-01-12 01:52:39 +01:00
Fabio Manganiello
ca855fce5d Improved Adafruit IO data handling 2019-01-12 01:38:17 +01:00
Fabio Manganiello
1087dae197 Added Adafruit IO backend 2019-01-12 01:07:38 +01:00
Fabio Manganiello
212cfb63c4 Lazy initialization of WeMo environment 2019-01-11 19:58:43 +01:00
Fabio Manganiello
33fd226fa1 Don't throw the exception if a certain Snapcast host is not reachable 2019-01-11 11:50:37 +01:00
Fabio Manganiello
29be2945cc Log trace before attempting a Snapcast connection 2019-01-11 11:46:13 +01:00
Fabio Manganiello
fbf3600e91 Setting thread and process names properly through prctl 2019-01-10 23:45:13 +01:00
Fabio Manganiello
56c7258c74 Setting names for threads 2019-01-10 23:08:29 +01:00
Fabio Manganiello
0bbfaf4498 If the mpd frontend receives an empty PlaylistChangeEvent, trigger an initPlaylist to update the playlist 2019-01-10 22:27:44 +01:00
Fabio Manganiello
a190184b0c Using an auxiliary map to keep track of the playing hosts to prevent errors when the items are removed by the worker threads while iterating them 2019-01-10 18:14:41 +01:00
Fabio Manganiello
2c8099e7ae Apply stream name filtering logic also to HTTP streams 2019-01-10 18:01:24 +01:00
Fabio Manganiello
f156e9c199 Refactored plugin so that errors are properly returned up the stack, client connections are lazy and re-initialized upon error 2019-01-10 17:51:33 +01:00
Fabio Manganiello
8759dafa0e Let plugin fail if unable to retrieve the status, so it can rely on the automatic reload mechanism instead of swallowing the error 2019-01-10 17:28:49 +01:00
Fabio Manganiello
abe80db47e Changed default for exclude_local from True to False 2019-01-10 17:25:25 +01:00
Fabio Manganiello
c619d89fa4 Added method to programmatically get the list of active Snapcast connections 2019-01-10 17:22:52 +01:00
Fabio Manganiello
a349b45ba4 Removed get_plugin utils method from web server, it messes up with also with the reentrant locks as it runs in another process. Refactored Snapcast frontend to get the backend hosts asynchronously through a plugin method 2019-01-10 11:52:39 +01:00
Fabio Manganiello
c1b05226a9 Made the mpd backend a bit more resiliant 2019-01-10 01:28:12 +01:00
Fabio Manganiello
6150e07fc9 Prevent toggle button id clash because of Snapcast using the MAC address of a device as a client (and therefore the same client connected to multiple servers may lead to inconsistent behaviour) 2019-01-10 00:29:22 +01:00
Fabio Manganiello
89ea4798bf Restored retry logic in mpd backend 2019-01-09 22:20:01 +01:00
Fabio Manganiello
156e2e8b5a Don't go crazy with plugin reload logic in the mpd backend in case of corrupted received messages 2019-01-09 22:05:53 +01:00
Fabio Manganiello
544979e7ff - Added position argument to music.mpd.add
- Added RSS feed parser plugin
2019-01-09 18:43:13 +01:00
Fabio Manganiello
464f84805f Added empty __init__.py to lib module 2019-01-09 15:13:10 +01:00
Fabio Manganiello
43ff0d4e25 Added hooks on light.hue web panel tab to synchronize light statuses with LightStatusChangeEvent events 2019-01-09 15:08:16 +01:00
Fabio Manganiello
d50d92e99e Added Philips Hue lights backend to monitor status changes to the lights 2019-01-09 09:21:48 +01:00
Fabio Manganiello
7c02c70663 Version bump 0.9.3 -> 0.9.4 2019-01-08 19:24:17 +01:00
Fabio Manganiello
9ba7a68578 Fixed modal height and positioning on screen 2019-01-08 19:23:06 +01:00
Fabio Manganiello
3c385a601f Exposing backend hosts and ports as both lists and JSON on Snapcast plugin 2019-01-08 18:24:59 +01:00
Fabio Manganiello
80bd5b684c Added support for setting/changing group streams on Snapcast 2019-01-08 17:43:20 +01:00
Fabio Manganiello
35292968ed Made get_plugin lock reentrant 2019-01-08 16:33:57 +01:00
Fabio Manganiello
19eab381ae Weird Jinja bug broke the web panel load when using JSON parse, had to refactor it a bit to fix it 2019-01-08 13:53:21 +01:00
Fabio Manganiello
d91e494940 Added group and host modals and settings to Snapcast UI 2019-01-08 12:54:33 +01:00
Fabio Manganiello
382866b1a4 Added content to Snapcast group modal 2019-01-08 10:13:13 +01:00
Fabio Manganiello
fd8c3bb846 Connected the wires between Snapcast backend and frontend 2019-01-08 01:47:16 +01:00