robweber / cronxbmc

A simple Cron-like service for Kodi
MIT License
19 stars 19 forks source link

Can't run folder in nexus 20.1 #30

Closed ilkarataev closed 1 year ago

ilkarataev commented 1 year ago

Hi, first thank you for your work on this project. I tried to run on new l=kodi nexus 20.1 on android system. And have error in logs

2023-03-25 22:54:01.015 T:27842   error <general>: GetItemsForPlayList: Unable to get playlist items for /sdcard/music/2-test
2023-03-25 22:54:01.018 T:27842    info <general>: VideoPlayer::OpenFile: /sdcard/music/2-test
2023-03-25 22:54:01.021 T:28071    info <general>: Creating InputStream
2023-03-25 22:54:01.023 T:28071    info <general>: Creating Demuxer
2023-03-25 22:54:01.024 T:28071   error <general>: Open - error probing input format, /sdcard/music/2-test
2023-03-25 22:54:01.024 T:28071   error <general>: OpenDemuxStream - Error creating demuxer
2023-03-25 22:54:01.024 T:28071    info <general>: CVideoPlayer::OnExit()
2023-03-25 22:54:01.135 T:27842    info <general>: CVideoPlayer::CloseFile()
2023-03-25 22:54:01.136 T:27842    info <general>: VideoPlayer: waiting for threads to exit
2023-03-25 22:54:01.137 T:27842    info <general>: VideoPlayer: finished waiting

my cron.xml file.

<?xml version="1.0" ?>
<cron>
  <job id="0" name="1-test" command_type="built-in" expression="48 22 * * *" command="PlayMedia(/sdcard/music/1-test, isdir)" show_notification="false" addon="service.cronxbmc" last_run="1679770080.923059" run_if_skipped="false"/>
  <job id="1" name="2-test" command_type="built-in" expression="58 22 * * *" command="PlayMedia(/sdcard/music/2-test, isdir,playlist_type_int=0)" show_notification="false" addon="service.cronxbmc" last_run="1679770680.037954" run_if_skipped="false"/>
  <job id="2" name="2-test1" command_type="built-in" expression="49 4 * * *" command="PlayMedia(/storage/music/2-test, isdir)" show_notification="false" addon="service.cronxbmc" last_run="1679769038.932086" run_if_skipped="false"/>
</cron>

I think it maybe kodi problem because cron try to run command. I tried add playlist_type_int=0 like we see in doc it's by default. Maybe you can give me advice. Thank you for your work one more time.

ilkarataev commented 1 year ago

I found way to solve this problem , we can use jsonrpc call.

<?xml version="1.0" ?>
<cron>
  <?xml version="1.0" ?>
<cron>
  <job id="0" name="1-test" command_type="json" expression="30 15 * * *" command='[{"jsonrpc":"2.0","method":"Playlist.Clear","params":[0],"id":11},{"jsonrpc":"2.0","method":"Playlist.Insert","params":[0,0,{"directory":"/storage/emulated/0/music/1-test/"}],"id":10},{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"position":0,"playlistid":0},"options":{}},"id":16011}]' show_notification="false" addon="service.cronxbmc" last_run="1679835180.239084" run_if_skipped="false"/> 
  <job id="1" name="2-test" command_type="json" expression="32 15 * * *" command='[{"jsonrpc":"2.0","method":"Playlist.Clear","params":[0],"id":11},{"jsonrpc":"2.0","method":"Playlist.Insert","params":[0,0,{"directory":"/storage/emulated/0/music/2-test/"}],"id":10},{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"position":0,"playlistid":0},"options":{}},"id":16011}]' show_notification="false" addon="service.cronxbmc" last_run="1679835180.239084" run_if_skipped="false"/> 
</cron>