PDA

View Full Version : consequences of database-stored playlists?



cdoherty
2005-07-13, 06:59
after updating trunk this morning (last update maybe two days ago), I had
to run build-perl-modules.pl and install a couple new Debian
packages. that went fine.

when I restarted, one of my playlists had been deleted. I assume it was
deleted from the database, since it doesn't show up in the list; it had
originated as a file, and the file was deleted as well. I had tried to
edit it at one point, so maybe that caused some kind of race condition
between the files and the database.

there were two things quirky about this playlist:

- it was 5 URLs for an internet stream (radioparadise.com).
- after the merge of the playlist-in-database stuff, I edited it because
the primary URL changed.

what exactly is the relationship between the playlists in the database and
the playlists on disk? are they ever synchronized? are playlists-on-disk
moribund? and (I feel silly for asking, but I can't find it in the docs)
without playlists-on-disk, how would one import a playlist, especially of
netcast URLs?

chris



-------------------------------
Chris Doherty
chris [at] randomcamel.net

"I think," said Christopher Robin, "that we ought to eat
all our provisions now, so we won't have so much to carry."
-- A. A. Milne
-------------------------------

cdoherty
2005-07-13, 07:02
On Wed, Jul 13, 2005 at 06:59:01AM -0700, Chris Doherty said:
> when I restarted, one of my playlists had been deleted. I assume it was
> deleted from the database, since it doesn't show up in the list; it had
> originated as a file, and the file was deleted as well. I had tried to
> edit it at one point, so maybe that caused some kind of race condition
> between the files and the database.

addendum: the four or five playlists (all of songs in my library) that I
created after the merge (and so were database-only) are also gone.

one of the modules I had to rebuild was DBD::SQLite, if that might matter.

chris


-------------------------------
Chris Doherty
chris [at] randomcamel.net

"I think," said Christopher Robin, "that we ought to eat
all our provisions now, so we won't have so much to carry."
-- A. A. Milne
-------------------------------

mherger
2005-07-13, 07:11
> when I restarted, one of my playlists had been deleted. I assume it was
[..]
> - it was 5 URLs for an internet stream (radioparadise.com).

This was the only playlist I had stored as well :-). And yes, it has gone.

There has been an update to the database schema. This usually will flush
the db and start a rescan of you collection. Now... this was the first
time since playlists are stored in the database. Today we know they don't
survive :-(. Feel free to open a bug on http://bugs.slimdevices.com.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

cdoherty
2005-07-15, 11:01
On Wed, Jul 13, 2005 at 04:11:59PM +0200, Michael Herger said:
> >when I restarted, one of my playlists had been deleted. I assume it was
> [..]
> >- it was 5 URLs for an internet stream (radioparadise.com).
>
> This was the only playlist I had stored as well :-). And yes, it has gone.
>
> There has been an update to the database schema. This usually will flush
> the db and start a rescan of you collection. Now... this was the first
> time since playlists are stored in the database. Today we know they don't
> survive :-(. Feel free to open a bug on http://bugs.slimdevices.com.

well.

I re-downloaded the RP playlist, put it in my playlist directory,
restarted, and a day or two later it was back in the playlist display. I
wonder if it sync'd up with my gratuitous nightly library rescan.

I'd like to add playlist ordering, anyway, since they're no longer
displayed in alphabetical order. I'll track down Dan's original patch and
see where to start (though hints are appreciated, of course).

FWIW, I think RP only got blown away because I had edited it--other
file-based playlists have survived.

chris


-------------------------------
Chris Doherty
chris [at] randomcamel.net

"I think," said Christopher Robin, "that we ought to eat
all our provisions now, so we won't have so much to carry."
-- A. A. Milne
-------------------------------

kdf
2005-07-15, 11:15
Quoting Chris Doherty <chris-slimdevices (AT) randomcamel (DOT) net>:

> I'd like to add playlist ordering, anyway, since they're no longer
> displayed in alphabetical order. I'll track down Dan's original patch and
> see where to start (though hints are appreciated, of course).

Pages.pm, around line 550:
return [ $ds->getInternalPlaylists, $ds->getExternalPlaylists ];

These refer to DataStores/DBIStore.pm:
Line 797
sub getExternalPlaylists {

Line 8007
sub getInternalPlaylists {

they are both return data in 'title' order, so the overall result should already
be ordered, but grouped by internal and external.

-kdf

michael
2005-07-15, 15:07
Chris Doherty <chris-slimdevices (AT) randomcamel (DOT) net> writes:
....
> FWIW, I think RP only got blown away because I had edited it--other
> file-based playlists have survived.

Yeah, it seems that with certain settings, edit/rename playlists will
eat files from your disk and turn them into db-only entries, and
unless you've been through this before, you probably won't even know.
If you follow that up at any point with "Clear library before rescan"
then they're gone for good.

-michael

--
Sic gorgiamus allos subjectatos nunc.

Dan Sully
2005-07-15, 15:28
* michael shaped the electrons to say...

>Chris Doherty <chris-slimdevices (AT) randomcamel (DOT) net> writes:
>...
>> FWIW, I think RP only got blown away because I had edited it--other
>> file-based playlists have survived.
>
>Yeah, it seems that with certain settings, edit/rename playlists will
>eat files from your disk and turn them into db-only entries, and
>unless you've been through this before, you probably won't even know.
>If you follow that up at any point with "Clear library before rescan"
>then they're gone for good.

If you can reproduce this, that'd be great.. or send a patch. ;)

-D
--
( ( ( [ ] ) ) )
In Stereo Where
Available

michael
2005-07-15, 17:37
Dan Sully <dan (AT) slimdevices (DOT) com> writes:
....
>>Yeah, it seems that with certain settings, edit/rename playlists will
>>eat files from your disk and turn them into db-only entries, and
>> unless you've been through this before, you probably won't even
>> know. If you follow that up at any point with "Clear library before
>> rescan"
>> then they're gone for good.
>
> If you can reproduce this, that'd be great.. or send a patch. ;)

1) blank any setting you have for Server Settings -> Playlists Folder
2) Browse Music Folder to a playlist on the file system, and click on it
3) rename the playlist
4) try to find the playlist on your hard drive
5) "Clear library before rescan", then try to find the playlist at all

For extra excitement, if you do this without a player attached, then
poke around a few more buttons, you can usually get slimserver to die
with a backtrace from Sync.pm

Can't call method "master" on an undefined value at /usr/src/slim/trunk/server/Slim/Player/Sync.pm line 390, <SRC> line 404.

For advanced thrill seekers, peek at the last few comments on bug 1360
to see how, with just the right navigation path, you can still get it
to eat a cuesheet or even an entire flac off your hard drive.

Still working towards a suitable patch. Mostly been focusing on the
cuesheet side of things, but perhaps it makes sense to have the
edit/rename playlist function refuse to operate on anything outside
the "Playlists Folder"? (as well as certain types of files.)
Just as a safety if some skin creates a url that exposes the
edit/rename widget in places it shouldn't. If you have any better
ideas or pointers, I'd be happy to hear them.

Thanks,

-michael

cdoherty
2005-07-21, 00:14
interesting--after updating to revision 3758, SlimServer has kindly left
my personal playlists untouched, but created a new playlist for every one
of my whole or partial albums.

anyone else see this?

chris


-------------------------------
Chris Doherty
chris [at] randomcamel.net

"I think," said Christopher Robin, "that we ought to eat
all our provisions now, so we won't have so much to carry."
-- A. A. Milne
-------------------------------

Dan Sully
2005-07-21, 07:57
* Chris Doherty shaped the electrons to say...

>interesting--after updating to revision 3758, SlimServer has kindly left
>my personal playlists untouched, but created a new playlist for every one
>of my whole or partial albums.
>
>anyone else see this?

Yes - fixed in 3759 :)

-D
--
<Nigel> Please refrain from fearing the reaper.