Author Topic: Value Converter  (Read 2863 times)

0 Members and 1 Guest are viewing this topic.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Value Converter
« on: June 03, 2009, 10:27:57 pm »
This is great fun getting tweets about new plugins, but what is this for and how does it work?

Quote
Value Converter needs a configuration file named valueconf.cfg that contains entries in following format fieldnumber|value|change to.

fieldnumber
Number and not name? If so, is this message still a valid reference for field numbers?

value and change to
Valid constants, I pressume. Is it the value of the whole field, or can it be a substring? For example, will it work like a "search and replace" to replace specified substrings in a memo field?

Does this change the data in the database, or just how it's displayed?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Value Converter
« Reply #1 on: June 03, 2009, 10:48:04 pm »
Quote
Number and not name?

It is always with numbers first, because easier to implement ...  ::)

Quote
If so, is this message still a valid reference for field numbers?

Use this file http://www.videodb.info/bin/Fields.pas. I will update the file in case numbers change.

Quote
Valid constants, I pressume

Anything

Quote
s it the value of the whole field, or can it be a substring? For example, will it work like a "search and replace" to replace specified substrings in a memo field?

It does not work as find and replace, but there will be such an option later. It works with whole values, the plugin can separate values in multivalue fields like genre.

Quote
Does this change the data in the database, or just how it's displayed?

Yes, it changes data in the database!
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Value Converter
« Reply #2 on: June 04, 2009, 01:31:30 am »
Quote
Valid constants, I presume.

By this, I meant constants but not variables. This is strictly for replacing specified fixed values with "change to" values, not for converting all my budget and box office data from USD to Euros. Right?

Quote
the plugin can separate values in multivalue fields like genre.

So I could change the genre "romance" to "chick flick," and a "comedy, romance" movie would become "comedy, chick flick"? 8)

Quote
Yes, it changes data in the database!

I suppose we need to be careful then. ;)

How is it invoked—just by the DLL and valueconf.cfg being present when the database is loaded? Is the idea to leave the configuration so the values will be changed whenever a plugin or script "updates" the fields to their old values?

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Value Converter
« Reply #3 on: June 04, 2009, 01:59:19 am »
Quote
By this, I meant constants but not variables. This is strictly for replacing specified fixed values with "change to" values, not for converting all my budget and box office data from USD to Euros. Right?

Right, but converting USD in Eur is an interesting idea. I'll consider implementing such a possibility as well.

Quote
So I could change the genre "romance" to "chick flick," and a "comedy, romance" movie would become "comedy, chick flick"? Cool

That's correct

Quote
How is it invoked—just by the DLL and valueconf.cfg being present when the database is loaded? Is the idea to leave the configuration so the values will be changed whenever a plugin or script "updates" the fields to their old values?

All general type plugins are executed with the application itself and ended with it. Such plugins run always in backgound. This particular plugin changes values right before they are going to the database file every time you edit data manually or using a plugin/script.
Gentlemen, you can’t fight in here! This is the War Room!