Clearing All Favourites

Volumio Information

Volumio Version: 2.861
Hardware: Raspberry Pi 4

How can I clear my entire favorites list?

At one point I favorited the top level folder of my music library, which recursively added thousands of tracks to my favorites list. Just loading page downloads 200MB of data from volumio and takes forever, and removing any entry from it takes tens of seconds, and can’t be batched as far as I can tell. Unfavouriting everything on the list one by one is a nonstarter, it would take weeks.

I found the favorites list in /data/favourites, this file is 10MB for me, and every time I remove it or reset it to [] it gets repopulated. This happens even if the volumio app is shut down, when I restart the app it repopulates this file.

Is it backing this list up on MyVolumio? Is it stored somewhere else?

I have the same issue. I need to delete all my favourites and it is very time consuming to do it one at a time. Is there a way to delete them all at once?

You will need to ssh into your device.

How to enable and use ssh.

Your favourites are contained in the folder ‘/data/favourites’. Here you will find the files ‘favourites’, ‘my-web-radio’, and ‘radio-favourites’.

Hello, i tried to delete favorite file by ssh but just after i restart system, they all come back, is there any solution?

This may be the worst solution to this problem but it (mostly) worked for me. I wrote a python script that uses the api to individually remove favorites in a loop, and let it run for a couple weeks. Note this was back on volumio 2 and the api may have changed. Replace 192.168.1.207 with the ip of one of your volumio instances.

#!/usr/bin/python3

import time
from socketIO_client import SocketIO
import json

import logging
logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
logging.basicConfig()

sio = SocketIO('192.168.1.207', 3000)

def on_push_state(*args):
    global status
    status = args[0]['status'].encode('ascii', 'ignore')
    print(status)

def on_response(*args):
    print("in response")
    print(args)

def onGetFavourites(*args):
    print("Got favourites")
    print(args)

def on_toast(*args):
    print("Got toast")
    print(args)

favourites = {}
removalRunning = False

def removeTracksFromFavourites(tracks):
    global removalRunning
    if removalRunning:
        return
    removalRunning = True
    uris = list([t["uri"] for t in tracks])
    for u in uris:
        print(u)
        sio.emit("removeFromFavourites",{
            "uri": u,
            "service": "mpd"
        }, on_response)
        sio.wait(seconds=0.5)
    removalRunning = False
    
def onPushBrowseLibrary(*args):
    print("Got Library")
    global favourites
    favourites = args[0]["navigation"]["lists"][0]["items"]
    print(len(favourites))
    open('/tmp/vf.json','w').write(json.dumps(favourites))
    removeTracksFromFavourites(favourites)
    
    
sio.on("pushToastMessage", on_toast)
sio.on('removeFromFavourites', on_response)
sio.on('pushState', on_push_state)
sio.on('pushBrowseLibrary', onPushBrowseLibrary)
#sio.emit('getState', '', 'lol')



def getFavourites():
    print("Getting Favourites")
    sio.emit("browseLibrary",{
        "uri": "favourites",
    }, on_response)
    sio.emit("pushQueue", [], on_response)
        
def gettracks():
    
    tracks = []
    with open('/tmp/tracks', 'r') as f:
        for t in f.read().split('\n'):
            tracks.append('mnt/' + t)
    return tracks
        

def main():
    getFavourites()
    tracks = gettracks()
    for t in tracks:
        print(t)
        sio.emit("removeFromFavourites",{
            "uri": t,
            "service": "mpd"
            }, on_response)
        sio.wait(seconds=1)
        
                         
    sio.wait()
    
    
            
if __name__ == "__main__":
    main()

2 years later, is there a way to clear the favorites list, i have tons of fav so i can’t do it one by one…