Yeah, another one in the game!
I am working now on a combination of the two scripts, if a new (unknown) card is presented, it creates a playlist with the id of the nfc-tag and also writes this into the MusicLibrary.txt.
So the only missing thing is to fill the playlist with music, which can be done within the LMS interface /App.
No need to use shh or command line...
The use of playlist is brilliant, would never have thought of that (i never use playists for anything, normally i am only listening to full Albums or radio)
Challenges:
The name of the playlist is only a number (or needs to be adapted via Musiclibrary.txt via ssh)
Will clean my code and upload the next days.
cubii
EDIT:
Have attached the script and the adapted player.py from LMSTools (replace it!), because i needed the function of playlist.save:
have a good new years eve!Code:def playlist_save(self, item): """ Play item :type item: str :param item: link to playable item """ # item = self.quote(item) self.request("playlist save {}".format(item))
Attachment 32745Attachment 32746
Results 11 to 19 of 19
Thread: Another Jukebox concept for kids
-
2020-12-30, 13:25 #11
- Join Date
- Dec 2016
- Posts
- 58
Last edited by cubii; 2020-12-31 at 07:15. Reason: added code
-
2021-01-01, 10:28 #12
- Join Date
- Jun 2011
- Posts
- 11
-
2021-01-02, 10:34 #13
- Join Date
- Apr 2019
- Posts
- 7
Great improvement !
in column 49 (PlayTagId_Cubii.py) there is a small typo:
.playlist_clear() must be player.playlist_clear()
A suggestion for improvement:
with player.playlist_get_current_detail(amount=1) we can get the "album name" of the current played album.
Isnt it possible to use this name as the playlist name of a new nfc-tag ?
- start a new album
- get the "album name"
- register the new nfc-tag and save the playlist with album name to LMS and Musiclibrary.txt
so no subsequent editing is necessary.
I am trying to implement this, but my knowledge of python is very very limited
and I don't know if I can do it.
Greetings
-
2021-01-02, 10:49 #14
- Join Date
- Dec 2016
- Posts
- 58
Oh, hoped it killed all errors, thanks for making this clear. ;-)
A suggestion for improvement:
- start a new album
- get the "album name"
- register the new nfc-tag and save the playlist with album name to LMS and Musiclibrary.txt
Greetings
I have many possible improvements on my virtuall list, but anything which is about the logic and handling and so on, we could get inspired by the Tonuino Projekt:
https://www.tonuino.de/ and comparable projects. They have pause, resume etc for books e.g. included but also some nice features like saving all information on the card, not on some list.
The Musiclibrary.txt file is my next project, i need to have it synchronised over 2-4 players...
Cu cubii
-
2021-01-06, 02:07 #15
- Join Date
- Apr 2019
- Posts
- 7
Another version of the script:
If a new rfidchip is registered, it creates a playlist with the name of the currently playing albumtag.
(Spaces are replaced by underscores).
If the playlist is empty, the uid of the rfidcard is saved as the name.
e.g.
- play a album "new audibook"
- use a new rfidcard
- the playlist "new_audiobook" will be saved (LMS/MusicLibrary.txt)
or
- the current playlist is empty
- use a new rfidcard
- the playlist "uid of rfidcard" will be saved (LMS/MusicLibrary.txt)
player.py not changed
Todo: Bookmarks
Reset Rfidchip
-
2021-01-06, 07:40 #16
- Join Date
- Dec 2016
- Posts
- 58
Nice work,
will try ASAP.
Anyone has an easy approach to get the Musiclibrary.txt syncronised, or saved on the server?Samba? Perhaps in the playlist folder. I have 2 Jukeboxes for my kids and now i am thinking to use nfc chips in every room...and the update of this file on every device just sucks...
cubii
-
2021-01-06, 12:49 #17
hi cubii,
Have a look at ~/.local/bin/copywww.sh
I have used this script during development for years to copy the pCP GUI to various RPi's for testing. Just modify the scp line to suit.
Code:#!/bin/sh # Version: 6.0.0 2019-06-30 #======================================================================================== # This script copies www and it's sub directories from the local piCorePlayer to a # remote piCorePlayer. It also does a backup. # # You will be prompted for the remote piCorePlayer's password twice. #---------------------------------------------------------------------------------------- if [ x"" = x"$1" ]; then echo "Usage: $0 192.168.1.xxx" exit 1 else scp -r -p /home/tc/www/* tc@$1:/home/tc/www/ ssh tc@$1 sudo filetool.sh -b fi exit 0
regards
Greg
-
2021-01-08, 05:29 #18
- Join Date
- Apr 2019
- Posts
- 7
New version with bookmarks and autosave MusicLibrary.txt
You must install the "bookmarks" plugin from sternenjaeger (third party plugin),
this must be configured, e.g. only children's audiobooks (genre) are monitored and given bookmarks (systemwide).
If a bookmark is available for a playlist startet by the rfid, it is played.
"playlistcontrol" was added to play.py, but only the "cmd:load index0" command.
(needs to be replaced)
MusicLibrary.txt is automatically saved after a write process,
you have to create a shell script (pcpbackup.sh) with the content "pcp bu"
Maybe there is a better way for the autosave function?
Todo: Reset
-
2021-01-09, 10:31 #19
- Join Date
- Jun 2011
- Posts
- 11