Author Topic: Export template to view the internal "Database Record ID"  (Read 19644 times)

0 Members and 1 Guest are viewing this topic.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
This is just a very small thing...

If you want to create a link to another movie in your database, did you ever wonder how to use "link type: ID"? The ID you'd need here is not the one from the "ID" field, but the unique one from the internal database index ("Database Record ID"). Just don't get confused!!  ;)

This "Database Record ID" is not visible in PVD.

How to create such a link in detail:
- select some text in the "Description" or "Comments" field (any custom fields should be fine, too)
- right click on the selected text and choose "Create Hyperlink"
- if you choose "Link type: ID", then "Value" has to be the hidden "Database Record ID" instead of the "ID" shown in PVD

Since I didn't find any other way to view the "Database Record ID", I wrote a very simple export template for that purpose (see attachment)

Move the template file "ID + Database Record ID + Title (Textfile).ptm" into the subfolder \Plugins\Templates of the PVD program folder. It will be listed in the menu "Export" after you restart PVD.

[attachment deleted by admin]

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2711
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #1 on: July 09, 2010, 01:36:46 pm »
Thank you for this one exports Database Record ID.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #2 on: July 09, 2010, 06:07:40 pm »
Quote
This is just a very small thing...

...and very interesting, but it just makes me wonder what the purpose of the link type is. I can't think of any situation where it would not be easier to use a title link. And a note of caution: I have no idea why, but using an ID link causes the viewdate of the target record to be reset. So it seems we have a bug in an obscure feature with an unknown purpose. :-\

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #3 on: July 10, 2010, 03:29:06 am »
I don't use title links cause there are different movies with the same title, for example Dracula (with Bela Lugosi) and Dracula (with Christopher Lee) or 3:10 to Yuma, Dawn of the Dead, The Blob, etc.: original and remake... The Database Record ID is the only field that is definitely unique for each entry in the database.
The other thing is, ID links (aside from true URLs) were the only ones that could be exported in a way that they are not broken in the exported file(s) (even that needed some complex string replacements and some javascript, see "HTML Frames" export template).

The seen date of the target stays fine on my PC... Again one of those bugs hard to reproduce, only occuring with certain configurations?  :(
« Last Edit: July 10, 2010, 05:17:23 pm by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #4 on: July 10, 2010, 05:48:05 am »
Quote
The seen date of the target stays fine on my PC... Again one of those bugs hard to reproduce, only occuring with certain configurations?

Are you using a skin that includes both viewed (the flag/date combo) and viewdate (just the date)?

Quote
I don't use title links cause there are different movies with the same title...

I thought of that, but figured I would rather make my Title unique and use that, than get the mid. Maybe mid should be added to the skin engine so it's available for this sort of thing.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #5 on: July 10, 2010, 01:19:07 pm »
Quote
Are you using a skin that includes both viewed (the flag/date combo) and viewdate (just the date)?
Yes. I'm using the standard "PVD Classic".

Quote
...than get the mid
I always use mid ("Database Record ID" is the same, if anyone get's confused now) because then I can export working links... But I understand your point and most users might prefer title links, as long as the title is unique... Don't know if I could make those work somehow in my export templates. JavaScript functions called from one frame (from the frame with the movie details), but relying on information from another frame (the title list on the left, where I would have to fetch the targeted title) are often blocked by browsers.  :'(
[Edit: I just tried if I could to get title links to work in my export templates and it was possible... :)]

Quote
Maybe mid should be added to the skin engine...
Oh yes, I would appreciate that. However, if it should be kept out of the movie details due to it's special nature: if you right click on a movie in the list, perhaps there could be a "Show internal Database Record ID".
I really like this link type, although I first assumed this should point to "Movie ID" (num) and not to "Database Record ID" (mid), but since my Movie IDs are not unique (I "misused" them as Media IDs and I'm really glad this is possible!!), I'm quite pleased to have some kind of truly unique pointer thing at hand with this "Database Record ID".
« Last Edit: July 10, 2010, 05:41:31 pm by svenne »

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #6 on: July 10, 2010, 01:33:45 pm »
Finally I can reproduce the bug. Hooray!!!  ;D :-\
It doesn't reset the viewdate, but sets it. If a viewdate is already there, it is not altered. That's what happens on my PC, at least... Can you confirm this bevaviour? Then I could post a small bug report.
« Last Edit: July 10, 2010, 05:19:37 pm by svenne »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #7 on: July 10, 2010, 09:31:04 pm »
What's happening is the view flag is being set off, but the date remains. This, of course, is an illogical condition. And turning the flag back on resets the date to today—so the correct date is lost. This only happens when Default viewed state (at Preferences - Movies - Information card) is set to "Not viewed." That's probably why you're seeing a different behaviour.

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #8 on: July 11, 2010, 09:42:02 am »
Ok, I tested it with altered preferences now and you're right. So it seems that viewed is always set to the default state (which additionally may result in changes/deletion of viewdate, of course).
« Last Edit: July 11, 2010, 04:49:09 pm by svenne »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export template to view the internal "Database Record ID"
« Reply #9 on: July 11, 2010, 11:09:29 pm »
Ok, I tested it with altered preferences now and you're right. So it seems that viewed is always set to the default state (which additionally may result in changes/deletion of viewdate, of course).

Yes, it is a bug. I will fix it in the next version and will provide a way to access the internal ID for advanced users.
Gentlemen, you can’t fight in here! This is the War Room!

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: Export template to view the internal "Database Record ID"
« Reply #10 on: July 11, 2010, 11:20:55 pm »
Great! And as always, of course: Thanks a lot!

 

anything