2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-19 00:26:03 +00:00

98_MediaList.pm: new readings: sortby and status for better

integration in FTUI


git-svn-id: https://svn.fhem.de/fhem/trunk@17958 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Tobias.Faust 2018-12-12 10:55:37 +00:00
parent c1e2ce3a42
commit 56835f794c
2 changed files with 31 additions and 17 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 98_MediaList.pm: new readings: sortby and status for better
integration in FTUI
- change: 49_SSCamSTRM: V2.1.0, change get popupStream to set popupStream
- feature: 49_SSCam: V7.7.0, autocreateCams command added to SVS device,
SSCamSTRM devices have get popupStream command, pls.

View File

@ -237,7 +237,11 @@ sub MediaList_Set($@)
return "no currentdir_playlist available, please select one" if($json eq "[]");
$json = MediaList_playlist_sort($json, $par, "asc");
readingsSingleUpdate($hash, "currentdir_playlist", $json, 1);
readingsBeginUpdate($hash);
readingsBulkUpdate($hash, "currentdir_playlist", $json);
readingsBulkUpdate($hash, "sortby", $par);
readingsEndUpdate($hash, 1);
return undef;
}
}
@ -426,6 +430,11 @@ sub MediaList_PlayListDel($$) {
####################################
sub MediaList_call_playlistinfo($$) {
my ($hash, $object) = @_;
readingsBeginUpdate($hash);
readingsBulkUpdate($hash, "status", "gathering filelist");
readingsEndUpdate($hash, 1);
#Log 3 , "$device: MediaList_call_playlistinfo";
$hash->{helper}{RUNNING_PID} = BlockingCall("MediaList_CollectID3Tags", $hash->{NAME}."|".$object, "MediaList_done_playlistinfo", 120); #, "MediaList_AbortFn", $hash
return undef;
@ -453,6 +462,8 @@ sub MediaList_done_playlistinfo($) {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash, "currentdir_playlist", $playlist);
readingsBulkUpdate($hash, "currentdir_playlistduration", $playlistduration);
readingsBulkUpdate($hash, "sortby", "File");
readingsBulkUpdate($hash, "status", "idle");
readingsEndUpdate($hash, 1);
@ -532,7 +543,8 @@ sub MediaList_CollectID3Tags ($) {
push(@data, $content);
# informiere Parent, aktualisiere playlist wenn Ausführung > 1sek
if(time() - $time >= 1) {
BlockingInformParent("MediaList_readingsSingleUpdateByName", [$device, "currentdir_playlist", JSON::XS->new->encode(\@data)], 0);
# manchmal wird danach die gesamte Liste nicht nochmal erneuert sodass diese unvollständig bleibt :(
#BlockingInformParent("MediaList_readingsSingleUpdateByName", [$device, "currentdir_playlist", JSON::XS->new->encode(\@data)], 0);
$time = time();
}
}