Skip to content

Commit 46a75ea

Browse files
committed
- fixing mplayer volume parsing error
- mpv cache will be on disk if < 500MB of memory is free
1 parent 01e8e32 commit 46a75ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pyradio/player.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ def updateStatus(self, *args):
861861
logger.debug('User input: {}'.format(disp))
862862
else:
863863
logger.debug('User input: {}'.format(subsystemOut))
864+
pass
864865

865866
with recording_lock:
866867
self.oldUserInput['Input'] = subsystemOut
@@ -885,7 +886,8 @@ def updateStatus(self, *args):
885886
sp = subsystemOut.split(token)
886887
subsystemOut = sp[0]
887888
with recording_lock:
888-
self.volume = ''.join(c for c in subsystemOut if c.isdigit())
889+
sp = subsystemOut.split(self_volume_string)
890+
self.volume = ''.join(c for c in sp[-1] if c.isdigit())
889891

890892
self_show_volume = self.show_volume
891893
self_oldUserInput_Title = self.oldUserInput['Title']
@@ -3592,7 +3594,7 @@ def _on_disk(self):
35923594
self._data['mpv'][2] = '--cache-on-disk=no'
35933595
return
35943596

3595-
if virt.available > 1073741824:
3597+
if virt.available > 500000:
35963598
self._data['mpv'][2] = '--cache-on-disk=no'
35973599
else:
35983600
self._data['mpv'][2] = '--cache-on-disk=yes'

0 commit comments

Comments
 (0)