reload a database, not refresh

Got an idea, post it here

Postby art on Thu Jul 13, 2006 4:17 pm

dgemily wrote:just to confirm, add a file in your movies repertory, then press your refresh button.. you will see that xlobby scan your repertory and will import the new file... is it right ?


That's absolutely right…

dgemily wrote:I suppose you do it when xlobby is running... and yes I tried it, like start xlobby, then delete an item from my xml database and did a refresh ( by using an event) and yes my item is not here right now if I press another time on the refresh button, xlobby rescan my folder and import/add the item that I have deleted...


Yes, that was exactly my point – if you modify your xml file (I don’t remember which attribute XL is looking for – created, modified or accessed) and then use refresh, XL will only reload the file without re-scanning your hard drive, on the other hand, if you’ll try to refresh without changing the file it will re-scan your folder.
art
 
Posts: 284
Joined: Sat Mar 20, 2004 8:40 am
Location: Allen, TX

Postby P3rv3rt B3ar on Thu Jul 13, 2006 10:23 pm

I dont know if im missing something here... but why write to xml directly... why just not use variable set and then write to db? sounds like bit cleaner approach to me.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby S Pittaway on Fri Jul 14, 2006 8:43 am

art

i tried it via the plugin, ie save, modify, then refresh and you are right, it doesent do a full refresh... it finishs in ~ 4 secs.

i guess that i have been hiting refresh more times than i have do a update? while testing

i still think an explicit reload event would still be usefull tho.



P3rv3rt B3ar

The reason for mofiying the xml directly is that i am adding data to each track in my music database, xlobby doest have a proper database manipulation interface so its painfully slow...

I also add ratings/lastplayed times to each track, which does not seem to be posible using current events (i tried and could not get it to work, also stuck a thread asking with n real succes).

Since i cant do it inside xlobby i cache up ratings/played times then add to the xml on shutdown.

A quick way of saving/loading means i can keep the fields upto date.


BTW, if you can come up with a good way of adding info to indiviudal tracks, please let me know, the way i have done it is very clunky (but it does work) and a clean method would be nice to know.

we need real find, update functions to do it properly.

whereas looping thro the complite music database file and adding data takes ~ 1 second, updating a playlist with a few songs in takes quite q while :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby P3rv3rt B3ar on Fri Jul 14, 2006 10:34 am

Ohh, i understand if u do update every item.

But when u update single items as theyre played... i have a way to do it by accessing just functions SDK offers, actually it is part of plugin im going to release soon... called xPerT... ive been working on it longtime now... but i just keep inventing and adding new functionality. I can make early compile available to u if u want, but how should i deliver it? is there possibility to PM on this forum? Well only problem which normal category methods did posses is, that they alone couldnt handle depth well... and music database is usually atleast depth 2 hence the problem. So what i have written is recursive algorithm which can handle any depth. But unfortunately it makes two requirements... 1) there needs to be unique "key" field, i ve been using %display% for this purpose, but its bit bad i should change it to %parameter% cause that is likely to be inherently unique 2) AFAIK u have to have physical category to represent every level in that database, but these cats can be dummy though (exist in never visited page). Meaning that if your music database is form artist>song... then u have to have on cat for artists and second to songs for my algorithm to work.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby S Pittaway on Fri Jul 14, 2006 2:18 pm

if a song is playing how do you find it in the category?

i guess you must do next/prev untill you find the track? this ends up taking ages when you have lots of tracks playing.

or is there a quick way of jumpinmg to an entry in a category? you cant do a custom search because it takes to long.

i think i played with most of the "clean" variations and could not get them to work well enuf.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby P3rv3rt B3ar on Fri Jul 14, 2006 3:56 pm

S Pittaway wrote:if a song is playing how do you find it in the category?

i guess you must do next/prev untill you find the track? this ends up taking ages when you have lots of tracks playing.

or is there a quick way of jumpinmg to an entry in a category? you cant do a custom search because it takes to long.

i think i played with most of the "clean" variations and could not get them to work well enuf.


True... im doing it in linear time now... but with a small change to my algorithm... it could be done in logarithmic time, i just havent implemented it cause, im currently working in videos and collection is not few ten of thousands but few hundreds...

But doing in logarithmic time is probably better than using xml... since unless u keep it all time in memory (which would be kind of redundant considering xlobby prolly does that) ur bound to handle it at best in linear time inherent from xml filestructure.

Lets say we have collection of 10000 songs distrbuted on 1000 albums avarage 10 track per album. And these albums are distributed for 200 artists, avarage 5 albums per artists. So that means 107.5 calls to nextitem() in avarage (215 in worst case scenario) thats huge improment compared 5000 calls avarage with doing search in linear time.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby cmhardwick on Fri Jul 14, 2006 8:23 pm

I would like to see the same feature as i have a similar sized music file and setup (remote computer for file storage) The initial import of my music files took close to an hour. I definitley don't want to go through that every time if I just post a change to a field in the xml, such as "last played date" or something.

Great product, can't wait to dig in and really start having fun, just have to find the time!
cmhardwick
 
Posts: 508
Joined: Fri Jul 14, 2006 6:07 pm
Location: Tennessee

Postby S Pittaway on Fri Jul 14, 2006 10:09 pm

i do store it in memory so finds are qucik, but you then have the update probs...

this sould be really be easy,

0.map a catergory onto music
1.start in artist view
2 find the artist
3.execute the category to show their albums
4.find the album
5.execute the category to show the tracks on the album
6.find the song
7.set variables

but it does not work because execute has no effect when the cat entry is a container???

is this a bug or iam i mising a call?


I also played with catergorys, using a filter i can get my music in artist view (say CAT).

if i have another category called CATdetails it shows me the albums for that artist (all neat so far).

but how do i map another category onto CATdetails to show the actual songs?

i tries CATdetailsdetails :) but that did not seem to work.

also, when doing this, ConvertVaiable only seems to work for display????
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby P3rv3rt B3ar on Thu Aug 03, 2006 11:14 pm

Hey Pittaway,

Did u find solution how to map more categories than two? i never really realised it was a problem... but now it seems to be on way of using my catwalk algorithms. Also if we forget the mapping... and use same physical category for different depth levels, did u find a way to enter subcategory programmatically?
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Previous