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 06-06-2011, 12:33 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Get list of MediaFiles imported/modified/removed after certain date?

I am considering creating a plugin that will need to obtain and store extra metadata for MediaFiles so it will be necessary to keep this in "sync" with external file changes as well as additions and removals from the Sage database. Is there an easy way to get a list of files that have been modified and added or removed from the database after a certain date? Or is there a better way to keep track of this? Thanks.
__________________
-Craig
Reply With Quote
  #2  
Old 06-06-2011, 12:46 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
There is no date stamp in the database that tracks modifications to the metadata. Changes to custom metadata properties will cause a .properties file to be written or updated, altering its revision date.

I'm not completely clear on what you're trying to do, but your best bet is probably to store your custom metadata directly in the database using Get/SetMediaFileMetadata rather than trying to keep in sync with an external database. If you need an additional date stamp, you can use those methods to create one (but of course only your code will know about it or update it).
__________________
-- Greg
Reply With Quote
  #3  
Old 06-06-2011, 01:01 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
BMT updates a custom field, ScrapedDate, when it automatically fetches metadata for an item... but nothing else knows about that field.
Reply With Quote
  #4  
Old 06-06-2011, 01:01 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
This would primarily be image files where the metadata is stored inside the file itself. So, mainly I am interested in when the file is modified by an external program and "refreshed" when the import directory is re-scanned by Sage without having to loop through all the MediaFiles and checking the (external) actual file modification date. I am interested in when files are removed so that I wouldn't be storing unnecessary information. Thanks for your help.
__________________
-Craig
Reply With Quote
  #5  
Old 06-06-2011, 07:12 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by cncb View Post
This would primarily be image files where the metadata is stored inside the file itself. So, mainly I am interested in when the file is modified by an external program and "refreshed" when the import directory is re-scanned by Sage without having to loop through all the MediaFiles and checking the (external) actual file modification date. I am interested in when files are removed so that I wouldn't be storing unnecessary information. Thanks for your help.
If you write a plugin... you can create register yourself for the MediaFileAdded and MediaFileRemoved events (you'd have to lookup the actual event names).
Reply With Quote
  #6  
Old 06-07-2011, 06:29 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by stuckless View Post
If you write a plugin... you can create register yourself for the MediaFileAdded and MediaFileRemoved events (you'd have to lookup the actual event names).
Thanks - I'll look into that.
__________________
-Craig
Reply With Quote
  #7  
Old 06-07-2011, 09:19 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Monitoring those events is not a guarantee that you'll see all additions and removals, since the user always has the option of disabling your plugin temporarily.
__________________
-- Greg
Reply With Quote
  #8  
Old 06-07-2011, 09:28 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post
Monitoring those events is not a guarantee that you'll see all additions and removals, since the user always has the option of disabling your plugin temporarily.
Good point. You could always run a java timer (You like that stuckless ). To run through and compare every night or user given time.
Reply With Quote
  #9  
Old 06-07-2011, 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 GKusnick View Post
Monitoring those events is not a guarantee that you'll see all additions and removals, since the user always has the option of disabling your plugin temporarily.
That can probably be managed in the code as well.... but personally, if users are disabling your plugin, then they can't expect the plugin to do what it's supposed to do when it's disabled. As a standard measure, you'd probably want to add a config option (ie, button) that enables your plugin to perform a full audit, that users can use if they feel their collection is out of sync.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow creation of MediaFiles Objects w/o an actual media file evilpenguin SageTV Studio 13 04-21-2011 11:57 AM
Export a list of imported videos [JiF]Mike SageTV Software 3 02-19-2008 04:20 PM
Imported Folders Removed, Contents Still Listed?? KJake SageTV Beta Test Software 5 07-10-2007 05:44 AM
List .MKV files on Imported videos Jabroni SageTV Software 1 12-26-2006 10:38 PM
More Upto date customisable properties list danward79 SageTV Software 0 01-02-2004 11:11 AM


All times are GMT -6. The time now is 12:57 PM.


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