xTopPicks v1.6

Xlobby plugin development

Re: xTopPicks v1.5

Postby defrag on Tue Mar 25, 2008 12:02 pm

Maybe my fault, I don't think I packaged the dll in a parent folder.

As scott says, create a folder called xTopPicks and place the dll in there... I'll repackage when I get scotts bug done
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: xTopPicks v1.5

Postby alamata on Tue Mar 25, 2008 12:09 pm

well,...
thanks for your answers

now the dialog box appears...

thanks...
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: xTopPicks v1.5

Postby scottw on Tue Mar 25, 2008 12:10 pm

defrag wrote:Maybe my fault, I don't think I packaged the dll in a parent folder.

As scott says, create a folder called xTopPicks and place the dll in there... I'll repackage when I get scotts bug done


How come all the bugs are mine :lol: :lol: :lol:

Just kidding I really appreciate your work on this!!!
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xTopPicks v1.6

Postby defrag on Wed Mar 26, 2008 12:07 am

v1.6 now out - link in first post - should do the trick scott - even tested it with track lengths!!!! (Now I have the top 20 shortest tracks.... :lol:)
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: xTopPicks v1.6

Postby scottw on Wed Mar 26, 2008 12:09 am

Cool will try it out!!!

Thanks,
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xTopPicks v1.6

Postby scottw on Wed Mar 26, 2008 11:58 am

defrag wrote:v1.6 now out - link in first post - should do the trick scott - even tested it with track lengths!!!! (Now I have the top 20 shortest tracks.... :lol:)


It works great defrag!!!!

Great job :D

I have already setup 2 filters for music, now I am trying to figure out creative ways to use this with my other CAT's 8) .


Thanks alot.
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xTopPicks v1.6

Postby defrag on Wed Mar 26, 2008 1:37 pm

Phew!!! I did a bit extra with the numerical one too, if you add a field that has non-numerical characters such as time e.g. 1:53 etc it strips out all non numeric characters allowing you to do the sort - hence my top list of short tracks :D

Enjoy... been a bit of a marathon this one
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: xTopPicks v1.6

Postby scottw on Wed Mar 26, 2008 1:40 pm

defrag wrote:Phew!!! I did a bit extra with the numerical one too, if you add a field that has non-numerical characters such as time e.g. 1:53 etc it strips out all non numeric characters allowing you to do the sort - hence my top list of short tracks :D

Enjoy... been a bit of a marathon this one


That's pretty cool and good thinking.

Yes a marathon indeed but your plugin works GREAT.

Really appreciate all of your work on this!!!!!!!
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xTopPicks v1.6

Postby S Pittaway on Thu Apr 03, 2008 8:07 am

its a really useful plugin defrag, cheers

i have to ask 1 question tho...

...how the hell do you parse the databases so quicky? :)
i seam to hit refresh and its done in next to no time, when i parse a db in xDatabase it seems to take a damm site longer!
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xTopPicks v1.6

Postby S Pittaway on Thu Apr 03, 2008 11:23 am

would it be posible to mod the plugin so you can run it against a database more than once?

I was knocking up a "recent" overlay that would show the last 10 films i have watched AND played and (i dont think) you can do this...

You could append the selected field to the category name to ensure they are unique (ie, xtoppick-movies-dateadded.xml and xtoppick-movies-dateplayed.xml).


Sean.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xTopPicks v1.6

Postby defrag on Thu Apr 03, 2008 6:31 pm

S Pittaway wrote:its a really useful plugin defrag, cheers

i have to ask 1 question tho...

...how the hell do you parse the databases so quicky? :)
i seam to hit refresh and its done in next to no time, when i parse a db in xDatabase it seems to take a damm site longer!


Hi Sean,

I simply :? load the database into an XmlDocument object, whilst doing that I add an index attribute on all <item/> elements. Then I construct an xpath statement on the field selected which then populates a XmlNodeList object and then dumps the index and field from this into an array. I sort the array depending on datatype then rebuild a database selecting item nodes that match on the index. All of this is being done in memory using the XML objects - which is why it is so darn fast!!!

e.g.
Code: Select all
XmlDocument inDoc = new XmlDocument();
Utils.LoadCategory(inDoc, c.BaseCatName);
// this next bit is in the above Utils function
// add an index tag to each item
XmlNodeList xNodes = xDoc.DocumentElement.SelectNodes("//item");
if (xNodes.Count > 0)
{
    for (int i = 0; i < xNodes.Count; i++)
        {
            XmlAttribute xAtt = xDoc.CreateAttribute("id");
            xAtt.Value = i.ToString();
            xNodes[i].Attributes.Append(xAtt);
          }
}
// I then create xpath to get the field data
string xpath = "//item[" + c.XPathFieldName() + "/text() != '']";
XmlNodeList xNodes = inDoc.SelectNodes(xpath);
//
for (int i = 0; i < xNodes.Count; i++)
{
    string data = xNodes[i].SelectSingleNode(c.XPathFieldName()).InnerText;
    // the rest populates arrays for sorting
}


S Pittaway wrote:would it be posible to mod the plugin so you can run it against a database more than once?

I've been thinking about adding multiple fields to sort on - if I could get people to load .Net 3.5 I could build up Linq statements and use Linq for XML which would be well cool. But I have had a brainwave that would mean using a DataTable object so you can add as many fields (columns) to sort or filter on and then use a SQL type approach to sort the DataTable. I can still use the indexer the same way I do with an array.

EDIT: i've just re-read what you typed... it's not multiple fields, but multiple sorts sequentially. No reason why not...hmmm I'll think a bit more. Although I'm beginning to like this SQL engine approach now too :D
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: xTopPicks v1.6

Postby S Pittaway on Fri Apr 04, 2008 7:55 am

nope, i mean somthing even easier (or you may even be able to do it) how do i create multiple txtoppicks batabase on the same physical database.

i want 2 separate xToppicks database
1= movies/date added.
2=movies /last played.

has far as i could see the dailog only lets you map one xl database to one xtoppicks database?


btw, i am doing the same kind of thing but in my plugins i end up processing/action on all the entries in the db so i guess that will slow it down alot..
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xTopPicks v1.6

Postby scottw on Fri Apr 04, 2008 12:20 pm

Sean,

You can do what you are asking, I do it now.

Just pick the cat to sort on and give it a cat name like music.last.added and set the settings. Save it and it should show on the right under "Configured Categories". Then go back up and select the same Category to sort on (ie. Music) and give it a different name like music.most.played. Setup all of its settings and save it .

Here is what mine looks like:

Image

Oh and you do have the latest version from this post, right??

Hope that helps.
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xTopPicks v1.6

Postby S Pittaway on Fri Apr 04, 2008 12:40 pm

...ill get my coat :)




i never noticed that it was editable, i guess you should not mess with new stuff late at night? :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xTopPicks v1.6

Postby scottw on Fri Apr 04, 2008 12:42 pm

:lol: :lol: :lol:
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

PreviousNext