PDA

View Full Version : Patch: Further (and final?) Cache updates...



Richard Purdie
2004-05-10, 11:48
Attached is a patch which should bring the Cache system to where I think it
should be (finally!). The extra file needs to be added as Slim/Music/Scan.pm
..

The patch does several things:

* Adds a TTL (Time to Live) field. This is used to see when the file was
last checked for changes. Every 5 minutes, it will compare filesize and
timestamp to see if it's changed. We don't do this on every access to the
Cache as perl IO routines to do this are slow on windows. This means we
should finally notice files that change and files that are deleted (within 5
mins of a change).
* Make all cache data accessible whilst rescans take place. Tricky but it
does this now. (The 'VALID' field is used to check whether data has been
touched as part of the rescan. If the data hasn't been marked as valid, it
gets wiped. This only happens upon rescan though).
* Allows all the data sources to be used at the same time (Moodlogic,
iTunes, MusicFolder). The rescan structure has been adjusted to mean all
enabled data sources get rescanned upon a rescan. To do this I've added an
extra file Slim::Music::Scan which controls MoodLogic.pm, iTunes.pm and
MusicFolderScan. Any call to rescan should now go to
Slim::Music::Scan::startScan which should do all the work
(Music::MusicFolderScan and Utils::Scan could probably be merged now).
* Fix iTunes code which was importing file://localhost/ instead of file:///
leading to duplicate entries in the cache
* Fix several song count errors. All these changes should leave the song
counters much more robust
* Fix some artwork code that was triggering a backtrace (fileURL conversion
leftover)
* Get rid of some unneccessary calls to CacheEntry before calling
updateCacheEntry (it will happily merge data itself)

Things that still need to be done:

Server Settings page: Could somebody with knowledge of the web settings
pages alter the Server Settings page so the audiodir, moodlogic and itunes
settings form a set of check boxes (and a text input box for audiodir)
please? The code itself is quite happy with mutiple sources but I looked at
the settings code and decided I'd end up breaking it if I tried to alter it
:-/.

Things that are never going to work:

Whilst we now notice files that disappear or change, we have no idea what to
alter in the cached data structures to reflect this. Obviously we can remove
the infoCache entry but updating the genreCache is just about impossible
with the current structure. The counts are therefore going to be slightly
off until a complete wipe cache occurs. I can't see an easy solution to
this.

Comments etc. welcome :)

Cheers,

RP

Dan Sully
2004-05-10, 12:01
* Richard Purdie <rpurdie (AT) rpsys (DOT) net> shaped the electrons to say...

>* Adds a TTL (Time to Live) field. This is used to see when the file was
>last checked for changes. Every 5 minutes, it will compare filesize and
>timestamp to see if it's changed. We don't do this on every access to the
>Cache as perl IO routines to do this are slow on windows. This means we
>should finally notice files that change and files that are deleted (within 5
>mins of a change).

Richard - have you seen Tie::Cache::LRU::Expires ? Do you think that can be taken advantage of?

-D
--
As of next Thursday, UNIX will be flushed in favor of TOPS-10.
Please update your programs.

Richard Purdie
2004-05-10, 12:13
Dan Sully:
> * Richard Purdie <rpurdie (AT) rpsys (DOT) net> shaped the electrons to say...
>
> >* Adds a TTL (Time to Live) field. This is used to see when the file was
> >last checked for changes. Every 5 minutes, it will compare filesize and
> >timestamp to see if it's changed. We don't do this on every access to the
> >Cache as perl IO routines to do this are slow on windows. This means we
> >should finally notice files that change and files that are deleted
(within 5
> >mins of a change).
>
> Richard - have you seen Tie::Cache::LRU::Expires ? Do you think that can
be taken advantage of?

I haven't but I've just had a look at its docs. It's not much use here as we
don't necessarily get rid of "expired" data from the cache - just make
careful checks about it's validity. (in fact 99% of the time it will still
be valid). We very rarely get rid of any data from the Cache as all the data
is equally valid and likely to be accessed. This new code should keep the
cache cleaner though.

The cache code is a bit of a nightmare really :).

Cheers,

RP

kdf
2004-05-10, 13:11
Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:


> Things that still need to be done:
>
> Server Settings page: Could somebody with knowledge of the web settings
> pages alter the Server Settings page so the audiodir, moodlogic and itunes
> settings form a set of check boxes (and a text input box for audiodir)
> please? The code itself is quite happy with mutiple sources but I looked at
> the settings code and decided I'd end up breaking it if I tried to alter it
> :-/.

I'm getting pretty used to settings. I'll give it a go as soon as I can test
this patch out.

-kdf

kdf
2004-05-10, 13:26
Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:

> To do this I've added an
> extra file Slim::Music::Scan which controls MoodLogic.pm, iTunes.pm and
> MusicFolderScan. Any call to rescan should now go to

looks nice. Scan.pm needs one small change, MoodLogic needs uppcase L:

line25: Slim::Music::MoodLogic::startScan();

-kdf

Richard Purdie
2004-05-10, 13:55
kdf:
> Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:
>
> > To do this I've added an
> > extra file Slim::Music::Scan which controls MoodLogic.pm, iTunes.pm and
> > MusicFolderScan. Any call to rescan should now go to
>
> looks nice. Scan.pm needs one small change, MoodLogic needs uppcase L:
>
> line25: Slim::Music::MoodLogic::startScan();

That typo is actually in CVS in MusicFolderScan.pm and I got caught when I
copied and pasted it! :)

It will be removed when this patch is applied (providing it does get applied
of course).

--
RP

kdf
2004-05-10, 14:37
Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:

> kdf:
> > Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:
> >
> > > To do this I've added an
> > > extra file Slim::Music::Scan which controls MoodLogic.pm, iTunes.pm and
> > > MusicFolderScan. Any call to rescan should now go to
> >
> > looks nice. Scan.pm needs one small change, MoodLogic needs uppcase L:
> >
> > line25: Slim::Music::MoodLogic::startScan();
>
> That typo is actually in CVS in MusicFolderScan.pm and I got caught when I
> copied and pasted it! :)

cool! so, its really my fault :) oops...

kdf
2004-05-10, 15:08
Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:

> kdf:
> > Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:
> >
> > > To do this I've added an
> > > extra file Slim::Music::Scan which controls MoodLogic.pm, iTunes.pm and
> > > MusicFolderScan. Any call to rescan should now go to
> >
> > looks nice. Scan.pm needs one small change, MoodLogic needs uppcase L:
> >
> > line25: Slim::Music::MoodLogic::startScan();
>
> That typo is actually in CVS in MusicFolderScan.pm and I got caught when I
> copied and pasted it! :)
>
> It will be removed when this patch is applied (providing it does get applied
> of course).

if there are no objections, I can commit this tonight along with the settings,
and some fixups I've done to moodlogic to have an updateinterval similar to iTunes.

Dean, if you have a preferred string to use for the new combined library
setting, let me know. Otherwise, it can always be changed later :)

"Music Library

Slimserver can make use of several different data sources, alone or combined.
Please check below, all sources you wish to use to create your music library in
addition to the directory where your music files are stored on your hard disk:"
[audiodir text box]

[x] Add iTunes music library and playlists.

[x] Add MoodLogic title and genre information, as well as instant mixes and
genre playlists.

Could also be simply: "Add iTunes" and "Add Moodlogic"

-kdf

dean
2004-05-10, 20:18
On May 10, 2004, at 3:08 PM, kdf wrote:
> "Music Library
>
> Slimserver can make use of several different data sources, alone or
> combined.
> Please check below, all sources you wish to use to create your music
> library in
> addition to the directory where your music files are stored on your
> hard disk:"
> [audiodir text box]
>
> [x] Add iTunes music library and playlists.
>
> [x] Add MoodLogic title and genre information, as well as instant
> mixes and
> genre playlists.
>
> Could also be simply: "Add iTunes" and "Add Moodlogic"

I think that these should be separate settings:

--------------------------------------
iTunes

SlimServer can import the information from your iTunes Music Library,
including song information and playlists. Check the box below to
import your iTunes Music Library information.

[x] Use iTunes [Change]

--------------------------------------
MoodLogic

SlimServer can import the information from MoodLogic, including title
and genre information as well as instant mixes and genre playlists.
Check the box below to import your MoodLogic music library information.

[x] Use MoodLogic [Change]
--------------------------------------
Your Music Folder

The directory where your music files are stored on your computer.

(D:\Music___________) [Change]

--------------------------------------
Rescan

If you add, remove or change music in your music library, you can have
SlimServer rescan your music to make sure its database is up to date.

[Rescan]

--------------------------------------

Now, if the user doesn't have MoodLogic or iTunes installed, then those
choices shouldn't be available. If the user has iTunes or MoodLogic
checked, then the folder scan shouldn't happen (i.e. use MoodLogic
and/or iTunes to figure out which songs to import). If neither are
checked (or neither are installed) then the regular folder scan should
be used.

How does this sound?

dean
2004-05-10, 20:19
On May 10, 2004, at 11:48 AM, Richard Purdie wrote:
> Whilst we now notice files that disappear or change, we have no idea
> what to
> alter in the cached data structures to reflect this. Obviously we can
> remove
> the infoCache entry but updating the genreCache is just about
> impossible
> with the current structure. The counts are therefore going to be
> slightly
> off until a complete wipe cache occurs. I can't see an easy solution to
> this.
If the user chooses to Rescan (not wipe) we could flush the genre cache
and then iterate over all the songs in the library and rebuild it.
This should all be in memory, so it should be reasonably fast.

kdf
2004-05-10, 22:48
sounds like it is being left just as it is. Don't even worry about changing the
strings. What exists will let the settings overlap.

just commit Richard's patch as is, and you should be fine.

-kdf

Quoting dean blackketter <dean (AT) slimdevices (DOT) com>:

>
> On May 10, 2004, at 3:08 PM, kdf wrote:
> > "Music Library
> >
> > Slimserver can make use of several different data sources, alone or
> > combined.
> > Please check below, all sources you wish to use to create your music
> > library in
> > addition to the directory where your music files are stored on your
> > hard disk:"
> > [audiodir text box]
> >
> > [x] Add iTunes music library and playlists.
> >
> > [x] Add MoodLogic title and genre information, as well as instant
> > mixes and
> > genre playlists.
> >
> > Could also be simply: "Add iTunes" and "Add Moodlogic"
>
> I think that these should be separate settings:
>
> --------------------------------------
> iTunes
>
> SlimServer can import the information from your iTunes Music Library,
> including song information and playlists. Check the box below to
> import your iTunes Music Library information.
>
> [x] Use iTunes [Change]
>
> --------------------------------------
> MoodLogic
>
> SlimServer can import the information from MoodLogic, including title
> and genre information as well as instant mixes and genre playlists.
> Check the box below to import your MoodLogic music library information.
>
> [x] Use MoodLogic [Change]
> --------------------------------------
> Your Music Folder
>
> The directory where your music files are stored on your computer.
>
> (D:\Music___________) [Change]
>
> --------------------------------------
> Rescan
>
> If you add, remove or change music in your music library, you can have
> SlimServer rescan your music to make sure its database is up to date.
>
> [Rescan]
>
> --------------------------------------
>
> Now, if the user doesn't have MoodLogic or iTunes installed, then those
> choices shouldn't be available. If the user has iTunes or MoodLogic
> checked, then the folder scan shouldn't happen (i.e. use MoodLogic
> and/or iTunes to figure out which songs to import). If neither are
> checked (or neither are installed) then the regular folder scan should
> be used.
>
> How does this sound?
>
>
>

Phil Barrett
2004-05-10, 22:52
On 11 May 2004, at 04:18, dean blackketter wrote:
> On May 10, 2004, at 3:08 PM, kdf wrote:
>> "Music Library
>>
>> Slimserver can make use of several different data sources, alone or
>> combined.
>> Please check below, all sources you wish to use to create your music
>> library in
>> addition to the directory where your music files are stored on your
>> hard disk:"
>> [audiodir text box]
>>
>> [x] Add iTunes music library and playlists.
>>
>> [x] Add MoodLogic title and genre information, as well as instant
>> mixes and
>> genre playlists.
>>
>> Could also be simply: "Add iTunes" and "Add Moodlogic"
>
> I think that these should be separate settings:
>
> --------------------------------------
> iTunes
> ...
> [x] Use iTunes [Change]
>
> --------------------------------------
> MoodLogic
> ...
> [x] Use MoodLogic [Change]
> --------------------------------------
> Your Music Folder
>
> The directory where your music files are stored on your computer.
>
> (D:\Music___________) [Change]
>
> Now, if the user doesn't have MoodLogic or iTunes installed, then
> those choices shouldn't be available. If the user has iTunes or
> MoodLogic checked, then the folder scan shouldn't happen (i.e. use
> MoodLogic and/or iTunes to figure out which songs to import). If
> neither are checked (or neither are installed) then the regular folder
> scan should be used.
>
> How does this sound?

It sounds different from kdf's text, which says that the folder scan
will happen in addition to iTunes and/or MoodLogic, meaning you can
have three separate repositories.

But both the above are confusing for iTunes or MoodLogic users, because
the music folder field looks like it must be filled in, though it's
actually optional if iTunes and/or MoodLogic is chosen. The text should
reflect this.

Phil

kdf
2004-05-11, 01:48
Quoting Phil Barrett <philb (AT) philb (DOT) co.uk>:

> On 11 May 2004, at 04:18, dean blackketter wrote:
> > On May 10, 2004, at 3:08 PM, kdf wrote:
> >> "Music Library
> >>
> >> Slimserver can make use of several different data sources, alone or
> >> combined.
> >> Please check below, all sources you wish to use to create your music
> >> library in
> >> addition to the directory where your music files are stored on your
> >> hard disk:"
> >> [audiodir text box]
> >>
> >> [x] Add iTunes music library and playlists.
> >>
> >> [x] Add MoodLogic title and genre information, as well as instant
> >> mixes and
> >> genre playlists.
> >>
> >> Could also be simply: "Add iTunes" and "Add Moodlogic"
> >
> > I think that these should be separate settings:
> >
> > --------------------------------------
> > iTunes
> > ...
> > [x] Use iTunes [Change]
> >
> > --------------------------------------
> > MoodLogic
> > ...
> > [x] Use MoodLogic [Change]
> > --------------------------------------
> > Your Music Folder
> >
> > The directory where your music files are stored on your computer.
> >
> > (D:\Music___________) [Change]
> >
> > Now, if the user doesn't have MoodLogic or iTunes installed, then
> > those choices shouldn't be available. If the user has iTunes or
> > MoodLogic checked, then the folder scan shouldn't happen (i.e. use
> > MoodLogic and/or iTunes to figure out which songs to import). If
> > neither are checked (or neither are installed) then the regular folder
> > scan should be used.
> >
> > How does this sound?
>
> It sounds different from kdf's text, which says that the folder scan
> will happen in addition to iTunes and/or MoodLogic, meaning you can
> have three separate repositories.
>
> But both the above are confusing for iTunes or MoodLogic users, because
> the music folder field looks like it must be filled in, though it's
> actually optional if iTunes and/or MoodLogic is chosen. The text should
> reflect this.

Again, the existing system makes is more clear for that, as in an either/or.
The point of Richard's patch, I thought, was that you would have the cached
folder scan, PLUS any number of additional scans, being iTunes and Moodlogic so
far. others may come. The idea I had was to make it an addition of itunes
and/or moodlogic to the main scan. I know of one user who has been very pleased
having moodlogic blended with the main scan. Moodlogic misses some genres that
you might like having from your tags.

still, maybe what this says is that there needs to be more thought. My idea
didn't allow a user to avoid the folder scan. Perhaps it needs a way to select
any individually OR in combination.

-kdf

Richard Purdie
2004-05-11, 02:01
kdf:
> Again, the existing system makes is more clear for that, as in an
either/or.
> The point of Richard's patch, I thought, was that you would have the
cached
> folder scan, PLUS any number of additional scans, being iTunes and
Moodlogic so
> far. others may come. The idea I had was to make it an addition of
itunes
> and/or moodlogic to the main scan. I know of one user who has been very
pleased
> having moodlogic blended with the main scan. Moodlogic misses some genres
that
> you might like having from your tags.
>
> still, maybe what this says is that there needs to be more thought. My
idea
> didn't allow a user to avoid the folder scan. Perhaps it needs a way to
select
> any individually OR in combination.

What I'd envisaged was something like:

--------------------------------------
iTunes

SlimServer can import the information from your iTunes Music Library,
including song information and playlists. Check the box below to
import your iTunes Music Library information.

[x] Use iTunes [Change]

--------------------------------------
MoodLogic

SlimServer can import the information from MoodLogic, including title
and genre information as well as instant mixes and genre playlists.
Check the box below to import your MoodLogic music library information.

[x] Use MoodLogic [Change]
--------------------------------------
Your Music Folder

SlimServer can scan a music folder for music files. If you would like to do
this enter the directory where your music files are stored on your computer
in the box below, otherwise leave it blank. This can be used in addtion to
any other method of finding files you have enabled (such as iTunes or
Moodlogic).

(D:\Music___________) [Change]

--------------------------------------

The Your Music Folder option always appears (but allows an empty value). The
Moodlogic and iTunes options appear if available and can be enabled/disabled
as required.

Does that make sense?

--
RP

Phil Barrett
2004-05-11, 09:35
On 11 May 2004, at 10:01, Richard Purdie wrote:
> What I'd envisaged was something like:
>
> --------------------------------------
> iTunes
>
> SlimServer can import the information from your iTunes Music Library,
> including song information and playlists. Check the box below to
> import your iTunes Music Library information.
>
> [x] Use iTunes [Change]
>
> --------------------------------------
> MoodLogic
>
> SlimServer can import the information from MoodLogic, including title
> and genre information as well as instant mixes and genre playlists.
> Check the box below to import your MoodLogic music library information.
>
> [x] Use MoodLogic [Change]
> --------------------------------------
> Your Music Folder
>
> SlimServer can scan a music folder for music files. If you would like
> to do
> this enter the directory where your music files are stored on your
> computer
> in the box below, otherwise leave it blank. This can be used in
> addtion to
> any other method of finding files you have enabled (such as iTunes or
> Moodlogic).
>
> (D:\Music___________) [Change]
>
> --------------------------------------
>
> The Your Music Folder option always appears (but allows an empty
> value). The
> Moodlogic and iTunes options appear if available and can be
> enabled/disabled
> as required.
>
> Does that make sense?

Yes, perfectly. It was when Dean rewrote it that it started to get
confusing.

Phil

dean
2004-05-11, 10:21
On May 11, 2004, at 2:01 AM, Richard Purdie wrote:
> What I'd envisaged was something like:
>
> --------------------------------------
> iTunes
>
> SlimServer can import the information from your iTunes Music Library,
> including song information and playlists. Check the box below to
> import your iTunes Music Library information.
>
> [x] Use iTunes [Change]
>
> --------------------------------------
> MoodLogic
>
> SlimServer can import the information from MoodLogic, including title
> and genre information as well as instant mixes and genre playlists.
> Check the box below to import your MoodLogic music library information.
>
> [x] Use MoodLogic [Change]
> --------------------------------------
> Your Music Folder
>
> SlimServer can scan a music folder for music files. If you would like
> to do
> this enter the directory where your music files are stored on your
> computer
> in the box below, otherwise leave it blank. This can be used in
> addtion to
> any other method of finding files you have enabled (such as iTunes or
> Moodlogic).
>
> (D:\Music___________) [Change]
>
> --------------------------------------
>
> The Your Music Folder option always appears (but allows an empty
> value). The
> Moodlogic and iTunes options appear if available and can be
> enabled/disabled
> as required.
>
> Does that make sense?

It does. I like it. I'd like to tweak this wording:

> SlimServer can scan a music folder for music files. If you would like
> to do
> this enter the directory where your music files are stored on your
> computer
> in the box below, otherwise leave it blank. This can be used in
> addtion to
> any other method of finding files you have enabled (such as iTunes or
> Moodlogic).

to:

Music Folder

You can specify a folder containing music files that SlimServer will
scan and
add to your music library. Enter the path to the folder below. You
can leave
this field blank if you are importing your music library information
from iTunes or
MoodLogic.

kdf
2004-05-11, 10:28
ok, looks workable to me. Dean, what do you think?

of course, if audiodir is allowed to be empty, we have to make sure that all the
checks for an empty audiodir look for moodlogic/itunes settings as well before
claiming there is no library. What does your scan code do if there is no
audiodir and moodlogc and itunes are both disabled?

-kdf

Quoting Richard Purdie <rpurdie (AT) rpsys (DOT) net>:

> kdf:
> > Again, the existing system makes is more clear for that, as in an
> either/or.
> > The point of Richard's patch, I thought, was that you would have the
> cached
> > folder scan, PLUS any number of additional scans, being iTunes and
> Moodlogic so
> > far. others may come. The idea I had was to make it an addition of
> itunes
> > and/or moodlogic to the main scan. I know of one user who has been very
> pleased
> > having moodlogic blended with the main scan. Moodlogic misses some genres
> that
> > you might like having from your tags.
> >
> > still, maybe what this says is that there needs to be more thought. My
> idea
> > didn't allow a user to avoid the folder scan. Perhaps it needs a way to
> select
> > any individually OR in combination.
>
> What I'd envisaged was something like:
>
> --------------------------------------
> iTunes
>
> SlimServer can import the information from your iTunes Music Library,
> including song information and playlists. Check the box below to
> import your iTunes Music Library information.
>
> [x] Use iTunes [Change]
>
> --------------------------------------
> MoodLogic
>
> SlimServer can import the information from MoodLogic, including title
> and genre information as well as instant mixes and genre playlists.
> Check the box below to import your MoodLogic music library information.
>
> [x] Use MoodLogic [Change]
> --------------------------------------
> Your Music Folder
>
> SlimServer can scan a music folder for music files. If you would like to do
> this enter the directory where your music files are stored on your computer
> in the box below, otherwise leave it blank. This can be used in addtion to
> any other method of finding files you have enabled (such as iTunes or
> Moodlogic).
>
> (D:\Music___________) [Change]
>
> --------------------------------------
>
> The Your Music Folder option always appears (but allows an empty value). The
> Moodlogic and iTunes options appear if available and can be enabled/disabled
> as required.
>
> Does that make sense?
>
> --
> RP
>
>

kdf
2004-05-11, 12:33
I have a request on this one...

now that we basically allow the audiodir to be blank, we have to bypass the test
in slimserver.pl:

if (!(defined Slim::Utils::Prefs::get("audiodir") &&
-d Slim::Utils::Prefs::get("audiodir")) &&
!$quiet &&
!Slim::Music::iTunes::useiTunesLibrary())

now, I CAN just add !Slim::Music::MoodLogic::useMoodLogic() to this and we're
off to the races. However, it seems that the new framwork allows new scanners
to be added. We should have a way to check for a scanner globally:

eh, Slim::Music::Scan::useScanner()

This would be true if moodlogic is chosen, or itunes, or both. Also, if there
is any other added scanner that has been plugged in and is on.

if nothing else, I'll have the settings done tonight so that Richard's patch can
get into the nightly build. I'll just add the moodlogic test for now, if no
other ideas come up before then.
-kdf

dean
2004-05-11, 12:54
Sounds great.

Rather than call them "scanners", how about generic "importer"?

Eventually, we should probably have:

Slim::Music::Importer::iTunes::
Slim::Music::Importer::MoodLogic::
Slim::Music::Importer::FolderScan::



Slim::Music::Importer::
On May 11, 2004, at 12:33 PM, kdf wrote:

> I have a request on this one...
>
> now that we basically allow the audiodir to be blank, we have to
> bypass the test
> in slimserver.pl:
>
> if (!(defined Slim::Utils::Prefs::get("audiodir") &&
> -d Slim::Utils::Prefs::get("audiodir")) &&
> !$quiet &&
> !Slim::Music::iTunes::useiTunesLibrary())
>
> now, I CAN just add !Slim::Music::MoodLogic::useMoodLogic() to this
> and we're
> off to the races. However, it seems that the new framwork allows new
> scanners
> to be added. We should have a way to check for a scanner globally:
>
> eh, Slim::Music::Scan::useScanner()
>
> This would be true if moodlogic is chosen, or itunes, or both. Also,
> if there
> is any other added scanner that has been plugged in and is on.
>
> if nothing else, I'll have the settings done tonight so that Richard's
> patch can
> get into the nightly build. I'll just add the moodlogic test for now,
> if no
> other ideas come up before then.
> -kdf
>

kdf
2004-05-11, 12:57
If that's the case, we should rename Slim::Music::Scan now, to avoid future
undefined function errors.

Seems there is a $totalScannersRunning count in that module, so I'll see if that
can be used for what I need.
-kdf

Quoting dean blackketter <dean (AT) slimdevices (DOT) com>:

> Sounds great.
>
> Rather than call them "scanners", how about generic "importer"?
>
> Eventually, we should probably have:
>
> Slim::Music::Importer::iTunes::
> Slim::Music::Importer::MoodLogic::
> Slim::Music::Importer::FolderScan::
>
>
>
> Slim::Music::Importer::
> On May 11, 2004, at 12:33 PM, kdf wrote:
>
> > I have a request on this one...
> >
> > now that we basically allow the audiodir to be blank, we have to
> > bypass the test
> > in slimserver.pl:
> >
> > if (!(defined Slim::Utils::Prefs::get("audiodir") &&
> > -d Slim::Utils::Prefs::get("audiodir")) &&
> > !$quiet &&
> > !Slim::Music::iTunes::useiTunesLibrary())
> >
> > now, I CAN just add !Slim::Music::MoodLogic::useMoodLogic() to this
> > and we're
> > off to the races. However, it seems that the new framwork allows new
> > scanners
> > to be added. We should have a way to check for a scanner globally:
> >
> > eh, Slim::Music::Scan::useScanner()
> >
> > This would be true if moodlogic is chosen, or itunes, or both. Also,
> > if there
> > is any other added scanner that has been plugged in and is on.
> >
> > if nothing else, I'll have the settings done tonight so that Richard's
> > patch can
> > get into the nightly build. I'll just add the moodlogic test for now,
> > if no
> > other ideas come up before then.
> > -kdf
> >

kdf
2004-05-11, 13:04
on second thought...it looks like Scan.pm isn't quite ready for that task
without a lot more work. In future, it could act much like Plugins.pm, adding
any importer found, etc. Right now, its still hardcoded for moodlogic and itunes.

-kdf

Quoting dean blackketter <dean (AT) slimdevices (DOT) com>:

> Sounds great.
>
> Rather than call them "scanners", how about generic "importer"?
>
> Eventually, we should probably have:
>
> Slim::Music::Importer::iTunes::
> Slim::Music::Importer::MoodLogic::
> Slim::Music::Importer::FolderScan::
>
>
>
> Slim::Music::Importer::
> On May 11, 2004, at 12:33 PM, kdf wrote:
>
> > I have a request on this one...
> >
> > now that we basically allow the audiodir to be blank, we have to
> > bypass the test
> > in slimserver.pl:
> >
> > if (!(defined Slim::Utils::Prefs::get("audiodir") &&
> > -d Slim::Utils::Prefs::get("audiodir")) &&
> > !$quiet &&
> > !Slim::Music::iTunes::useiTunesLibrary())
> >
> > now, I CAN just add !Slim::Music::MoodLogic::useMoodLogic() to this
> > and we're
> > off to the races. However, it seems that the new framwork allows new
> > scanners
> > to be added. We should have a way to check for a scanner globally:
> >
> > eh, Slim::Music::Scan::useScanner()
> >
> > This would be true if moodlogic is chosen, or itunes, or both. Also,
> > if there
> > is any other added scanner that has been plugged in and is on.
> >
> > if nothing else, I'll have the settings done tonight so that Richard's
> > patch can
> > get into the nightly build. I'll just add the moodlogic test for now,
> > if no
> > other ideas come up before then.
> > -kdf
> >

kdf
2004-05-11, 13:13
one last thing before I have to get back to day job...

having the audiodir empty, does nasty things when you click Browse Music Folder.

-kdf

dean
2004-05-11, 13:32
If the audiodir is empty, then there shouldn't be a Browse Music Folder
link...


On May 11, 2004, at 1:13 PM, kdf wrote:

> one last thing before I have to get back to day job...
>
> having the audiodir empty, does nasty things when you click Browse
> Music Folder.
>
> -kdf
>

kdf
2004-05-11, 13:44
Quoting dean blackketter <dean (AT) slimdevices (DOT) com>:

> If the audiodir is empty, then there shouldn't be a Browse Music Folder
> link...

that's done for default, but there is nothing to stop anyone from calling
"browse.html?dir="

and right now, even in Default, the system only blocks on useItunesLibrary. if
you are using moodlogic and no audiodir...boom.

it should probably be blocked at a lower level than just not appearing in the skin.
-kdf

Lars Kellogg-Stedman
2004-05-12, 14:14
> Eventually, we should probably have:
>
> Slim::Music::Importer::iTunes::
> Slim::Music::Importer::MoodLogic::
> Slim::Music::Importer::FolderScan::

Yes! That is exactly what I've been wanting to write about!

Having poked about the iTunes module somewhat, I would love to see a
clean "plugin" interface for what you've called the "Importer" modules.
With the current code, references to iTunes, MoodLogic, etc., are
scattered throughout the codebase, making it hard to add new sources
(maybe I've got all my MP3 files catalogued in a SQL database, or via
XML-RPC, or something).

Ideally, the "setup" information for each module would be relocated into
the module itself, so that:

(a) Slim::Music::Importer would provide routines for enumerating the
available modules, and

(b) The user would explicitly choose to use one (or more, maybe -- I'm
not sure about the wisdom of "multiple sources") of the available
plugins. Each module would have a seperate configuration screen that
would only be visible if the module were "active".

That would be great!

-- Lars