Playlists may be long to browse and thus should be lazy loaded #61
Closed
Description
A playlist made of URIs pointing to remote resources can be long to browse.
Albums must be browsed early to identify their artist names. For playlists there's no such motivation and we could wait until the user ask for playlist details to load the playlist content.
To reproduce, create a playlist with > 30 channels from https://somafm.com/.
Typical log:
2022-10-15 08:11:27,368 EventLoopThread DEBUG: argos.controllers.playlists - Completing description of playlist with URI 'm3u:Somafm.m3u8'
2022-10-15 08:11:27,368 EventLoopThread DEBUG: argos.controllers.playlists - Fetching tracks of playlist with URI 'm3u:Somafm.m3u8'
2022-10-15 08:11:27,368 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 72 with method core.library.lookup
2022-10-15 08:11:27,460 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 711714 to 712714
2022-10-15 08:11:28,462 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 712714 to 713714
2022-10-15 08:11:29,464 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 713714 to 714714
2022-10-15 08:11:30,466 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 714714 to 715714
2022-10-15 08:11:31,467 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 715714 to 716714
2022-10-15 08:11:32,468 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 716714 to 717714
2022-10-15 08:11:33,470 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 717714 to 718714
2022-10-15 08:11:34,472 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 718714 to 719714
2022-10-15 08:11:35,474 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 719714 to 720714
2022-10-15 08:11:36,476 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 73 with method core.playback.get_time_position
2022-10-15 08:11:40,476 EventLoopThread DEBUG: argos.ws - JSON-RPC command 73 cancelled
2022-10-15 08:11:40,477 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 720714 to -1
2022-10-15 08:11:41,479 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 74 with method core.playback.get_time_position
2022-10-15 08:11:45,480 EventLoopThread DEBUG: argos.ws - JSON-RPC command 74 cancelled
2022-10-15 08:11:45,481 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:11:46,483 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 75 with method core.playback.get_time_position
2022-10-15 08:11:50,484 EventLoopThread DEBUG: argos.ws - JSON-RPC command 75 cancelled
2022-10-15 08:11:50,485 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:11:51,487 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 76 with method core.playback.get_time_position
2022-10-15 08:11:55,490 EventLoopThread DEBUG: argos.ws - JSON-RPC command 76 cancelled
2022-10-15 08:11:55,490 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:11:56,492 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 77 with method core.playback.get_time_position
2022-10-15 08:12:00,496 EventLoopThread DEBUG: argos.ws - JSON-RPC command 77 cancelled
2022-10-15 08:12:00,496 EventLoopThread WARNING: argos.ws - Closing Mopidy websocket connection after >5 consecutive send failures
2022-10-15 08:12:00,502 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:12:01,505 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 78 with method core.playback.get_time_position
2022-10-15 08:12:01,506 EventLoopThread WARNING: argos.ws - Connection reset while sending JSON-RPC command 78
2022-10-15 08:12:01,506 EventLoopThread DEBUG: argos.ws - JSON-RPC command 78 cancelled
2022-10-15 08:12:01,506 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:12:02,508 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 79 with method core.playback.get_time_position
2022-10-15 08:12:02,509 EventLoopThread WARNING: argos.ws - Connection reset while sending JSON-RPC command 79
2022-10-15 08:12:02,509 EventLoopThread DEBUG: argos.ws - JSON-RPC command 79 cancelled
2022-10-15 08:12:02,509 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:12:03,511 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 80 with method core.playback.get_time_position
2022-10-15 08:12:03,512 EventLoopThread WARNING: argos.ws - Connection reset while sending JSON-RPC command 80
2022-10-15 08:12:03,512 EventLoopThread DEBUG: argos.ws - JSON-RPC command 80 cancelled
2022-10-15 08:12:03,512 EventLoopThread DEBUG: argos.model.utils - Property 'time_position' already equal to -1
2022-10-15 08:12:03,527 EventLoopThread DEBUG: argos.ws - Connected to mopidy websocket at http://192.168.1.45/mopidy/ws
2022-10-15 08:12:03,527 EventLoopThread DEBUG: argos.model.utils - Property 'connected' already equal to True
2022-10-15 08:12:04,514 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 81 with method core.playback.get_time_position
2022-10-15 08:12:04,526 EventLoopThread DEBUG: argos.ws - Received result of JSON-RPC command 81
2022-10-15 08:12:04,527 MainThread DEBUG: argos.model.utils - Updating 'time_position' from -1 to 749787
2022-10-15 08:12:05,528 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 749787 to 750787
2022-10-15 08:12:06,530 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 750787 to 751787
2022-10-15 08:12:07,532 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 751787 to 752787
2022-10-15 08:12:08,534 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 752787 to 753787
2022-10-15 08:12:09,535 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 753787 to 754787
2022-10-15 08:12:10,536 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 754787 to 755787
2022-10-15 08:12:11,538 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 755787 to 756787
2022-10-15 08:12:12,540 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 756787 to 757787
2022-10-15 08:12:13,542 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 757787 to 758787
2022-10-15 08:12:14,544 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 82 with method core.playback.get_time_position
2022-10-15 08:12:14,556 EventLoopThread DEBUG: argos.ws - Received result of JSON-RPC command 82
2022-10-15 08:12:14,557 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 758787 to 759817
2022-10-15 08:12:15,559 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 759817 to 760817
2022-10-15 08:12:16,560 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 760817 to 761817
2022-10-15 08:12:17,562 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 761817 to 762817
2022-10-15 08:12:18,564 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 762817 to 763817
2022-10-15 08:12:19,566 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 763817 to 764817
2022-10-15 08:12:20,568 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 764817 to 765817
2022-10-15 08:12:21,569 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 765817 to 766817
2022-10-15 08:12:22,571 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 766817 to 767817
2022-10-15 08:12:23,572 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 767817 to 768817
2022-10-15 08:12:23,772 MainThread DEBUG: argos.placement - Storing application window size and position
2022-10-15 08:12:24,574 EventLoopThread DEBUG: argos.ws - Sending JSON-RPC command 83 with method core.playback.get_time_position
2022-10-15 08:12:24,586 EventLoopThread DEBUG: argos.ws - Received result of JSON-RPC command 83
2022-10-15 08:12:24,591 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 768817 to 769849
2022-10-15 08:12:25,588 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 769849 to 770849
2022-10-15 08:12:26,590 MainThread DEBUG: argos.model.utils - Updating 'time_position' from 770849 to 771849
2022-10-15 08:12:27,370 EventLoopThread WARNING: argos.ws - Timeout 60s excedeed while waiting response of JSON-RPC command 72 with method core.library.lookup
2022-10-15 08:12:27,370 EventLoopThread DEBUG: argos.ws - JSON-RPC command 72 cancelled
2022-10-15 08:12:27,370 MainThread DEBUG: argos.model.model - Completing playlist with URI 'm3u:Somafm.m3u8'