SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-04-2009, 07:52 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
SetMediaFileMetadata?

I am trying to add a couple custom metadata properties in my app. I am using SetMediaFileMetaData here is an example

Name: "SMWMediaType"
Value: "Blu-Ray"

It seems to set the property right in the .properties file but it also sets about 5 or 6 null = null and I wasn't sure where that was coming from?

TIA
Reply With Quote
  #2  
Old 07-04-2009, 08:54 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
My guess is that sometimes you are calling SetMediaFileMetaData with a null key and value.

Just curious, but wouldn't sage's IsBluRay() api call return wheter or not the media is a BluRay?
Reply With Quote
  #3  
Old 07-04-2009, 09:46 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Not when your Blu rays rips aren't in native format

I am just tesing with the exact values above it gets In the properties file but still puts the null in also if you change the value it adds another property instead of changing the existing
Reply With Quote
  #4  
Old 07-04-2009, 03:32 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
The property changes are appended to the .properties file, but when they are read back by sage, then only the last appended entry is retained.
Reply With Quote
  #5  
Old 07-05-2009, 10:40 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
The property changes are appended to the .properties file, but when they are read back by sage, then only the last appended entry is retained.
Okay that makes sense. I will check it out and see if the null's dissapear as well still don't know what is putting them there.
Reply With Quote
  #6  
Old 07-05-2009, 08:43 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
just as a side note do people think it is wise to start "cluttering" up the metadata with "random" extra metadata fields? I know plucky has a legitimate reason for wanting to add a "bluray" tag for movies that are not in a blurary container...but the same thing could be accomplished by requiring users to include bluray or BD in the title of the mkv (or whatever container). Likewise the same thing could be required for DVDs that arent in a dvd folder container. Personally i think the metadata should be just that... metadata.... and even the extra metadata fields should have some uniformity to them.

To make calling this simpler in sage someone could even write a jar (or include this in one of the ones that is written already (ie sagemc)) that check for these in the filename and return a true/false boolean.
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #7  
Old 07-05-2009, 11:37 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
I don't really see it as "cluttering" it up I see the properties fields as just that properties for the media file that can be used by sage as long as the additional properties relate accordingly.. I think adding it to the title could create problems when do metadata lookups
Reply With Quote
  #8  
Old 07-06-2009, 07:20 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
ya i can see that... then i propose we create a "standard" metadata field like MediaType (or something similar if that one is already taken) and then have it equal a standard set of values... BluRay, DVD, or TV for example and then everyone can use the standard set.... thoughts?
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #9  
Old 07-06-2009, 09:11 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I agree with razrsharpe. That's why a group of us collaborated on the new metadata fields that were used by central fanart. If not, then I would have used BMTMediaType, BMTMediaTitle, etc and EP would have used, MSMediaType, etc, etc. I would propose that if you are going to add a new metadata field, then you start a discussion and get collaboration and input on the field, field name, possible uses, etc.

If you go with SMWMediaType, then no other tool/plugin is going to adopt it, because it the field "belongs" to SMW".

Collaborating with others on the introduction of new metadata fields will ensure that your metadata field choices get adopted by others, and will reduce the "clutter". For example, if you introduce, SMWMediaType, will your plugin remove SMWMediaType from the mediafile metadata when the plugin is removed? If not, then when SMW is removed, then your plugin's metadata is now "clutter" (like adding stuff to windows registry, and never cleaning it out). But if it's a general purpose metadata field, then other plugins will probably use it as well.

Currently, in BMT, i need to know the content type of a media file, so I internally use a "ContentType" metadata field, although I never write it out. I only use it to determine if the current media file is a DVD or not. So i can see the value in adding a metadata field for SubMediaType or ContentType.
Reply With Quote
  #10  
Old 07-06-2009, 09:22 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Okay so where would this discussion best be started? Customizations?
Reply With Quote
  #11  
Old 07-06-2009, 09:32 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by PLUCKYHD View Post
Okay so where would this discussion best be started? Customizations?
Yeah... I would think that somewhere under customizations.... i think the original metadata fields for fanart was started under sagemc, but that's probably the wrong place for it.
Reply With Quote
  #12  
Old 07-06-2009, 07:17 PM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Is that a new method with the next release? I see it says Since: 6.6 in the javadocs. I found it was better to use a seperate xml file to store the data so it doesn't muk up the wiz.bin.. Of course you must be willing to have the code in place to maintain it...

Thanks,
Jeff
Reply With Quote
  #13  
Old 07-06-2009, 09:24 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
The advantage of using the .properties is that Sage will load it automatically... even the custom metadata fields.
Reply With Quote
  #14  
Old 07-07-2009, 12:45 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Is there a way to delete the metadata? I only see a Get and Set...

Thanks,
Jeff
Reply With Quote
  #15  
Old 07-07-2009, 05:46 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
You could try to set null (or empty string) into the value and see what happens. It may not remove the field entry, but it would probably set it to null (my guess).
Reply With Quote
  #16  
Old 07-14-2009, 01:04 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
You could try to set null (or empty string) into the value and see what happens. It may not remove the field entry, but it would probably set it to null (my guess).
Yes it sets it to null doesn't remove it though
Reply With Quote
  #17  
Old 07-27-2009, 12:10 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
The property changes are appended to the .properties file, but when they are read back by sage, then only the last appended entry is retained.
This is not holding true in my testing. It is keeping a running talley of the properties I am editing.

Using MediaTag and addings new tages with ;newtag; seperators.

Also have the option of setting the tag to null.

It appends and reads the tags okay from within sage but in the actual properties file it is keeping a running total like below
MediaTags=;Jamie;

MediaTags=;Jamie;;PLUCKYHD;

MediaTags=null

MediaTags=;PLUCKYHD;

MediaTags=null

MediaTags=;PLUCKYHD;

MediaTags=

MediaTags=;skye;

MediaTags=;skye;;jamietest;

MediaTags=

MediaTags=

anyone know hot to avoid this sure makes the properties file look cluttered.
Reply With Quote
  #18  
Old 07-27-2009, 12:38 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Basically, Sage simply opens and appends to the .properties file as you call SetMediaFileMetadata(). It does this since, it is a lot more efficient (in their case) to append the values and then to read, update, and write the values each time SetMediaFileMetadata is called.

You can turn off the writes to the .properties if it bothers you. (I don't know the option off hand, but Narflex documented it in the release notes)

In the case of the properties that you have listed above, when the .properties file is re-read, MediaFile will be blank, since the last thing written to it was an empty string. Are you seeing something different in your testing?
Reply With Quote
  #19  
Old 07-27-2009, 01:23 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
Basically, Sage simply opens and appends to the .properties file as you call SetMediaFileMetadata(). It does this since, it is a lot more efficient (in their case) to append the values and then to read, update, and write the values each time SetMediaFileMetadata is called.

You can turn off the writes to the .properties if it bothers you. (I don't know the option off hand, but Narflex documented it in the release notes)

In the case of the properties that you have listed above, when the .properties file is re-read, MediaFile will be blank, since the last thing written to it was an empty string. Are you seeing something different in your testing?
No the results in testing are what I would expect inside sage 100% just wish they got purged from the actually properties files themselves but I digress
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.