lotan / rhythmbox-ampache

Rhythmbox plugin to stream music from Ampache
GNU General Public License v2.0
21 stars 7 forks source link

cache file created but not updated #15

Closed lachlan-00 closed 6 years ago

lachlan-00 commented 7 years ago

I was trying to work out why my cache was never being saved and it looks like the step of writing to cache isn't actually writing anything. the file gets created but data isn't written.

Traceback (most recent call last): File "/home/user/.local/share/rhythmbox/plugins/ampache/AmpacheBrowser.py", line 334, in songs_downloaded_cb

data[1].append_to_async(

AttributeError: '_io.TextIOWrapper' object has no attribute 'append_to_async'

                                # append to cache file
                                print("write chunk %s[%d] to file..." % (playlist_name, data[0]))
                                data[1].append_to_async(
                                        Gio.FileCreateFlags.NONE,
                                        GLib.PRIORITY_DEFAULT,
                                        Gio.Cancellable(),
                                        open_append_cb,
                                        GLib.Bytes.new(''.join(lines).encode('utf-8')))
lotan commented 6 years ago

I'm so sorry for not replying earlier, github didn't notify me by email.

If you are still interested:

My guess would be that your PyGObject is older that 2.15.3.

According to

https://mail.gnome.org/archives/gnome-announce-list/2008-August/msg00087.html

Wrap GFile.append_to_async

append_to_async was added then.

Can you check the version of PyGObject in your distribution?

lachlan-00 commented 6 years ago

Thank you, i have been running stretch so it must be the library version. i'm on buster now so i'll try again.