Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    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:

    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))
    have a good new years eve!
    Attachment 32745Attachment 32746
    Attached Files Attached Files
    Last edited by cubii; 2020-12-31 at 07:15. Reason: added code

  2. #12
    Junior Member
    Join Date
    Jun 2011
    Posts
    11
    Quote Originally Posted by cubii View Post
    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:

    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))
    have a good new years eve!
    Attachment 32745Attachment 32746
    Cool, I buy it ! I'll give a try this weekend
    btw, is there a way to change the thread title (my mistake) ? it's very serious work in here !

  3. #13
    Junior Member
    Join Date
    Apr 2019
    Posts
    9
    Quote Originally Posted by cubii View Post
    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:

    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))
    have a good new years eve!
    Attachment 32745Attachment 32746
    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

  4. #14
    Quote Originally Posted by chschind View Post
    Great improvement !

    in column 49 (PlayTagId_Cubii.py) there is a small typo:
    .playlist_clear() must be player.playlist_clear()
    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
    Nice idea!

    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

  5. #15
    Junior Member
    Join Date
    Apr 2019
    Posts
    9
    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
    Attached Files Attached Files

  6. #16
    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

  7. #17
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,314
    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
    It will prompt for passwords unless you "Setup passwordless ssh access". Probably no worth the effort unless you do it alot.

    regards
    Greg

  8. #18
    Junior Member
    Join Date
    Apr 2019
    Posts
    9

    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
    Attached Files Attached Files

  9. #19
    Junior Member
    Join Date
    Jun 2011
    Posts
    11
    Quote Originally Posted by chschind View Post
    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
    Brilliant, I'll try it. many thanks for sharing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •