Variable to add a new item in db

Got an idea, post it here

Variable to add a new item in db

Postby dgemily on Mon May 02, 2005 10:39 pm

Variable set and unset are very nice but if we can add a new item in the database, it will be very powerful . :wink:

Is it possible Steven ?

dge
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dgemily on Mon May 09, 2005 1:30 pm

Please Steven, I need this feature for a future application in xlobby.
And I’m sure, we will use also this feature in others applications

Thx,

dge.
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby m_ski on Thu May 19, 2005 10:06 pm

I agree - this would be very useful feature so that we can add fields to a database item if it does not already exist. I have an idea that this could be used for a 'time last played' field which could then be used to display the most recently played albums, maybe on the main menu page.
Unless anybody knows another way of doing this?
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby dgemily on Thu May 19, 2005 10:27 pm

m_ski wrote:I agree - this would be very useful feature so that we can add fields to a database item if it does not already exist.


m_ski, you can already add a field to a database item using the command "category:Variable Set"

look at this post: http://www.xlobby.com/forum/viewtopic.php?p=15656#15656

:wink:

but we can't add an item, only field :cry:
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby Colby on Thu May 19, 2005 11:29 pm

DGEm, I didnt know it wasnt possible.
So if you have an existing database, and you use a category>variable set wont you be adding an item, if the variable and field are labled? Granted it would be a PITA if you were doing a lot, but does it not add an item? If the textbox button>input could be used as a standard for the variable in the category>variable set, then an onscreen keyboard could be used.
Colby
 
Posts: 929
Joined: Mon Feb 02, 2004 7:42 am
Location: Brookline Station, MO, USA

Postby m_ski on Fri May 20, 2005 11:32 am

I have had problems trying to change a field that already exists.

Do I need to remove the field first with 'variable unset' and then set it again with 'variable set' or should it work on a field that already exists?
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby dgemily on Fri May 20, 2005 12:14 pm

So if you have an existing database, and you use a category>variable set wont you be adding an item, if the variable and field are labled?

How do you want that I label the variable and the field?
If I try to add a field using category>variable set. it will add a field to the selected item not for the selected database/category.
I will do some more tests because I did use le button>item with my tests to add an item… but I’m pretty sure that you can’t add an item… If you find a solution, let me know it.


I think it should be pretty nice, if we can use as field parameter of the “variables set” command, something like:

Field= item>FIELD to add a new item or modify it in the selected category/database
Field= subitem>FIELD to add a new subitem or modify it in the selected item
Field= FIELD to add a new field or modify it in the selected item

And maybe 1 other variable like:
Field= information>FIELD to add or modify a field in the part <information> of the selected item or subitem

So like that we should able to build a customizable database via the skin with: item, subitem and select if you want add a field “information” or not ( for cover, parameter type etc….)

An other thing, if we can combine these parameter, like :
item>FIELD>subitem>FIELD>information>FIELD so like that we can add or modify an item, a subitem and a field in the part information of the subitem.

I don’t know if it makes a sense. but my principal request is to add a new item

Later,
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dgemily on Fri May 20, 2005 12:16 pm

m_ski wrote:I have had problems trying to change a field that already exists.

Do I need to remove the field first with 'variable unset' and then set it again with 'variable set' or should it work on a field that already exists?


That should work on a field that already exists ?
look at the colby2 skin for the userrating fonction :wink:
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby m_ski on Mon May 23, 2005 7:33 pm

Thanks Colby,

I had a look at your skin and can now get it working - 'sort of'.

I want to save a variable (current date and time) to a new field (lastplayed).I can save a text string but I can't seem to get the variable to work.

I am doing the following...

Variable Set
Category: Music
Variable: lastplayed
Value: %datetime>u%

I have tried various date formats but none seem to work. I have seen in other posts that I should be able to save a variable to a database field. Can someone explain exactly how I would get this to work with the datetime variable?
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby Colby on Mon May 23, 2005 11:09 pm

I thought I asked in a post sometime b4 if it was possible to datestamp db items with the %datetime>u% variable. It was never implemented as far as I knew. So it should be a feature request. Steven only created certain variables when he made variable set.

You may be able to do it another way if you can get input button save to work. http://www.xlobby.com/forum/viewtopic.php?p=20024#20024

Good luck.
Colby
 
Posts: 929
Joined: Mon Feb 02, 2004 7:42 am
Location: Brookline Station, MO, USA

Postby m_ski on Fri May 27, 2005 12:07 pm

I have a bit of theory as to how this could be done, a bit complicated but it might work....

When xlobby wants to know the current date and time it sends a message to girder,
This then triggers a LUA script in girder which grabs the date and time parameters all into separate girder variables (i.e. day, month, year, hour, minute). - I don't know how to do this yet but I don't think it will be very difficult.
Girder then does 5 different sendmessage commands back to xlobby each containing a parameter for the value of each of the items.
i.e. sendmessage params=1000, 26 (means day=26)
sendmessage params=1001, 12 (means month=december)
sendmessage params=1002, 05 (means year=05)

Then depending on the message there would be a whole load of triggered events in xlobby which would set the individual parameters (i.e. 12 different triggered events to get month name into a new variable called 'GirderMonth').

This would need well over 100 separate triggered events (60mins, 24hrs, 31 days, 12 months, 10years) but these could be fairly easily created with copy and paste in a text editor with the xml event file I would have thought.

After this is all done you would have 5 different user variables giving you the complete date and time (to the nearest minute).

Questions I have;
Could these 5 different varaibles be combined together and put into 1 field of a database item?
Would the receiving of the sendmessage commands from girder work at the same time as other events are occurring (i.e. while I am in the process of starting to play an album I want to be able to gather the date and time and put these values into the database before the user has chance to change the database so it is looking at a different album)?

Hope this makes a bit of sense to somebody.
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby m_ski on Wed Jun 15, 2005 11:49 am

I have managed to achieve the datetime integration with Girder to implement a lastplayed function.

See post at http://www.xlobby.com/forum/viewtopic.php?t=3321
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby dgemily on Fri Jul 08, 2005 12:18 pm

Just tell me if you consider integrating it. if not, I need to find an other way…if yes, I will wait ;)


thanks :wink:
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby lar282 on Thu Nov 10, 2005 7:08 am

So is it possible or not to add a ITEM to a database or is it still a feature to come?


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby dgemily on Thu Nov 10, 2005 8:47 am

lar282 wrote:So is it possible or not to add a ITEM to a database or is it still a feature to come?


//Lasse

it's not possible... (not yet) Iwill love to have this possibility....
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Next