Editing a database item externally...possible?

Help each other out

Postby S Pittaway on Mon Oct 09, 2006 12:15 pm

close winamp and re-open it...


thats not the same, i guess steve stores the winamp process that he opened... if that is killed simply starting a new instance of winamp wont help.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby buymeapc on Mon Oct 09, 2006 2:48 pm

I am writing a plugin that edits the xlobby xml databases and mine works OK by modifying the xml file, NOT creating a new xml file.


Hmm...maybe if I rewrite my code, I can have the app simply replace all the lines in the xml file...

Guess I gotta put my vbscript/autoit hats back on. :wink:
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby tswhite70 on Mon Oct 09, 2006 4:45 pm

Actually, both methods should work without issue (overwriting the current file and editing/resaving the current file).

Try this to take your app out of the picture. Open XL, now open your database in Notepad and change something (the display field for an item for instance), save the file. Now click your category refresh event, the field should change on the screen and the category view should switch back to the front/top if you were somewhere else.

If it doesn't work then something is wrong with your category definition. I had a problem with a category I was using a while back where Xlobby would not refresh the category for anything and the symptom was very much like you are describing, in troubleshooting it actually appeared that Xlobby would lose the category/db association on refresh. Changing the category name fixed my issue - in my case the db was named InTheaters and the category was named InTheaters - I tried a million things to figure it out and changing the category name to anything else worked fine but I could not make it work with the original name.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby buymeapc on Mon Oct 09, 2006 4:54 pm

That's very interesting to hear you say that. My category name and database name are the same as well.

I'll definitely have to try changing the category name!!

Thanks! I'll let you guys know tonight! :D
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby buymeapc on Tue Oct 10, 2006 1:11 am

Ok, I hope I'm not getting exciting too early, but changing the category name worked!! :D :D :!:

I will check back tomorrow night after it functions again since the problem seemed to occur when I leave it alone for a while.

So far so good. I'm keeping my fingers crossed.
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby buymeapc on Wed Oct 11, 2006 1:29 pm

Ok, bad news....changing the category name did not fix my problem :(

So, I'm back to basics again.

Anybody have any new ideas?
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby tswhite70 on Wed Oct 11, 2006 3:49 pm

Too bad that didn't fix it - did you delete the category and recreate with the new name? I don't know if that will make any difference but if it is something wierd with the category definition just renaming the category might not fix it.

After reading your post again about the database not being editable after refresh - maybe it is your xml? Make sure you are writing as UTF-8. Make sure you close the file in your app before peforming the refresh. Double check the file in IE for XML errors (although I'm sure that's not your problem since it loads up after restart).

Does the refresh work without issue if you are just editing the db file in Notepad?

What's the database called? Is there a import template for that database name? If so maybe that's causing issues.

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby buymeapc on Thu Oct 12, 2006 1:00 am

Before, I only renamed the category. Now, I've deleted the category and recreated it. The info was immediately pulled from the xml file.

The xml is using UTF-8 and can be opened just fine with either firefox or IE.

I edited the xml file with notepad while in xlobby and refreshed the category and the info changed without a problem.

I didn't use a template with this xml file - created it from scratch. The name of it is "UpcomingRecordings.xml".

There is one thing that has been happenning since day one with this database. Whenever I open the xlobby menu (F2) and go to databases, if I click on refresh, the refresh window sort of stays motionless - the progress bar doesn't start. I need to close the refresh window manually by clicking the x in the upper right corner. The close button doesn't appear either....maybe this is an indication of what may be going wrong?

Here's a screenshot:
http://img157.imageshack.us/img157/1407/displaybx2.png

EDIT:
I just deleted the xml file via xlobby and clicked the add xml database button - the info did not return to the text fields....hmmm

The text fields are populated with the correct info, now, too - but appear empty. Why?
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby tswhite70 on Thu Oct 12, 2006 6:33 pm

I could be wrong about this, but it is my understanding that if your app is writing the DB file in full (ie not just modifiying a DB created by Xlobby)then you:
Should not have a template for the DB.
Should not have <paths> statements in your XML.
Should never use the F2\Database\Refresh button.
Should never use the Add Database button.

If you have template or <path> statements in your XML I think Xlobby uses those to try and refresh the database itself. You don't want that since your app writes the DB file. If there is not a template or <path> statements the category>refresh just reloads the category from the DB.

Not sure if this is what's happening in your case but your comment about hitting F2\Databases\Refresh button has me concerned.

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby buymeapc on Fri Oct 20, 2006 3:42 am

Ok, I think I'm out of the woods so to speak. 8)

I recoded my app so it now only rewrites the xml file instead of overwriting it. I have been testing this since last week and all has gone well.

So, I think all is well.

Thank you all for your help! :D
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Postby buymeapc on Sun Oct 29, 2006 1:29 am

Ok, my app is working great! Worked out all the bugs (so I think). It now displays the upcoming scheduled recordings for BTV 4.

The only bad thing is that it's an external app and not a plugin...oh well :roll:

If anyone is interested in it, just let me know. BTV 4 is required.



Should I create a thread in the plugins forum?
buymeapc
 
Posts: 59
Joined: Wed Mar 22, 2006 5:53 pm

Previous