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 05-01-2010, 01:14 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Viewing History for Imported Videos?

Is there any way to get a viewing history for Imported Videos, even if the video has been deleted? I can see how the viewing history can be determined using Airings, but not for imported videos.

All I really need to determine is if a specific video has been imported sometime in the past but is now deleted.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #2  
Old 05-02-2010, 10:41 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by tmiranda View Post
Is there any way to get a viewing history for Imported Videos, even if the video has been deleted? I can see how the viewing history can be determined using Airings, but not for imported videos.

All I really need to determine is if a specific video has been imported sometime in the past but is now deleted.
I don't think there is a way or will be a way. You could keep it yourself in something external but would not be easy that is for sure....

Wouldn't really know what you would keep filename/showname/titlename it would be pretty hard.
Reply With Quote
  #3  
Old 05-02-2010, 11:06 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I really do not want to keep track of it myself but I do not see a way of doing it otherwise.

I'm working on making the Malore Online Browser automatically record Podcasts that are selected as Favorites. I'm looking for a way to keep track of what's already been downloaded, I mean recorded , and then deleted so I do not download the same podcast again. (Similar to the way Sage will not re-record TV shows that have already been watched, even if you delete the recording after watching it.)

I have figured out a way to uniquely identify Podcasts that have been downloaded so I can tell which podcasts are "new" and which are already in the library but this only works for files that are physically on the disk. Once you DeleteFile() for an imported video the Show metadata is also removed. (As far as I can tell. I was hoping I was wrong about this.)

The other option I have is to make the downloaded podcasts Airings instead of imported media, but I'm not sure I like the idea of messing with the Airings portion of the database. I've spent several hours reading posts on the subject and it just seems to be a can or worms.

Suggestions welcome. (Greg, this is where you can chime in and tell me what I'm doing that's stupid so I can get smarter )

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #4  
Old 05-02-2010, 11:24 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I don't really have much to add. You've pretty much answered your own question: once a video has been deleted from the import database, there's no record of it anymore. If you want to avoid downloading things twice, it's up to you to keep a record of what you've already downloaded. In your shoes I would do this in a separate file, without trying to shoehorn it into Wiz.bin.
__________________
-- Greg
Reply With Quote
  #5  
Old 05-02-2010, 11:53 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
That's what I'm thinking as well. Better I screw up my own .properties file instead of the wiz.bin

On a somewhat related topic, I'm using java.util.Properties.load and .save to access a custom .properties file. When I save the file the properties are not saved alphabetically. I know there is a way to make the .properties file save alphabetically but I can't remember what it was. Do you know?
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 05-02-2010, 06:03 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
See this thread by me ran into the same issue

http://forums.sagetv.com/forums/showthread.php?t=46224

the next to last post by jriechen will tell you an example on how to save them sorted.
Reply With Quote
  #7  
Old 05-03-2010, 04:44 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Thanks Plucky, I knew I saw this issue discussed befire but I could not find the answer. So the short answer is that it must be sorted manually.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #8  
Old 05-04-2010, 05:50 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by tmiranda View Post
Thanks Plucky, I knew I saw this issue discussed befire but I could not find the answer. So the short answer is that it must be sorted manually.
no problem it isn't really hard to implement that Right before the save....but I agree you would think this would be something the property class would already do/support.
Reply With Quote
  #9  
Old 05-04-2010, 08:32 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
here's some code to sort properties (put this in its own java file...):
Code:
import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Vector;

public class SortedProperties extends Properties {

        public Enumeration keys() {
                Enumeration keysEnum = super.keys();
                Vector<String> keyList = new Vector<String>();
                while (keysEnum.hasMoreElements()) {
                        keyList.add((String) keysEnum.nextElement());
                }
                Collections.sort(keyList);
                return keyList.elements();
        }
}
then when you define your property map rather then using:
Code:
Properties props = new Properties();
use this:
Code:
SortedProperties props = new SortedProperties();
When you do this its completely transparent.... no need to do anything special... works a like a treat this is what ortus does for its property files


EDIT: While I'm sharing figured I'd just share the code that we use to save a property file (will save all property's in sage***.properties with a parent of parentprop)...
Code:
        public static boolean SaveSagePropertyFile(String filename, String parentprop, String DoNotSaveProps){

                ArrayList propkeys = ortus.api.GetSagePropertyAndChildren(parentprop);
                SortedProperties props = new SortedProperties();


                FileOutputStream propfile = null;

                String[] DoNotSavePropsArray = DoNotSaveProps.split(",");
                for (String s : DoNotSavePropsArray){
                        propkeys.remove(s);
                        propkeys.remove(parentprop.concat("/").concat(s));
                }
                ortus.api.DebugLog(LogLevel.Trace2, "SageSaveProperyFile, Props to save: " + propkeys);

                for (String propkey : (String[])propkeys.toArray(new String[0])){
                        props.setProperty(propkey, ortus.api.GetSageProperty(propkey, ""));
                }

                ortus.api.DebugLog(LogLevel.Info,"SageSavePropertyFile, Filename: " + filename);

                try{
                        propfile = new FileOutputStream(filename);
                        props.store(propfile, "TVE Settings file");
                        propfile.close();
                        ortus.api.DebugLog(LogLevel.Info, "SageSavePropertyFile, Success");
                        return true;
                }
                catch(IOException ioe){
                        ortus.api.DebugLog(LogLevel.Error, "SageSavePropertyFile, I/O Exception: " + ioe);
                        return false;
                }


        }
__________________
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

Last edited by razrsharpe; 05-04-2010 at 08:40 PM.
Reply With Quote
  #10  
Old 05-05-2010, 05:52 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Thanks razrsharpe. I've got this on the "To Do" list once I get the new functionality actually working.

Why is it that when you start on something the cycle goes something like this
:
1 You first think "Wow, this will be a lot of work."
2 Next you think "It's really not so bad and it won't take too much time."
3 Next "Hmm, it's harder than I thought."
4 Next "Man, I forgot about that issue... and that issue... and that issue..."
5 Next "Holy crap, I'll never finish this."
6 Many, many hours later "Just a few more things to fix..."
7 More hours later "Only one or two things left to do."
8 More hours later "just one last thing to get right ..."
9 "Finally!"

I'm on step 6
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #11  
Old 05-05-2010, 06:35 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by tmiranda View Post
Thanks razrsharpe. I've got this on the "To Do" list once I get the new functionality actually working.

Why is it that when you start on something the cycle goes something like this
:
1 You first think "Wow, this will be a lot of work."
2 Next you think "It's really not so bad and it won't take too much time."
3 Next "Hmm, it's harder than I thought."
4 Next "Man, I forgot about that issue... and that issue... and that issue..."
5 Next "Holy crap, I'll never finish this."
6 Many, many hours later "Just a few more things to fix..."
7 More hours later "Only one or two things left to do."
8 More hours later "just one last thing to get right ..."
9 "Finally!"

I'm on step 6
I think you are a little wrong it usually goes to step 6 and then jump back to step 3 and repeat
Reply With Quote
  #12  
Old 05-05-2010, 07:33 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by PLUCKYHD View Post
I think you are a little wrong it usually goes to step 6 and then jump back to step 3 and repeat
ya very rarely have i ever gotten to step 9 ... and when i do its usually "meh, thats close enough to call done "
__________________
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
  #13  
Old 05-09-2010, 03:49 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
razrsharpe,

The SortedProperties class worked great. Thank you!

I really appreciate all of the help you, Plucky, stuckless and Greg have given me. You all have saved me tons of time.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #14  
Old 05-09-2010, 08:22 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by tmiranda View Post
razrsharpe,

The SortedProperties class worked great. Thank you!

I really appreciate all of the help you, Plucky, stuckless and Greg have given me. You all have saved me tons of time.

Tom
no prob
__________________
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
  #15  
Old 05-09-2010, 09:31 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by tmiranda View Post
razrsharpe,

The SortedProperties class worked great. Thank you!

I really appreciate all of the help you, Plucky, stuckless and Greg have given me. You all have saved me tons of time.

Tom
No worries without stuckless and Greg I would not be were I am today. (and of course Razor and I have been teaching each other as well. )
Reply With Quote
  #16  
Old 05-10-2010, 01:56 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
An update to this in case anybody needs the info in the future. I had to keep track of the viewing history manually. I did it by:

- Creating a unique string that identifies the Video. The string uses the show title, episode title, author, description and a few other items. Hopefully this results in a string that is unique for each show. This is not fool-proof, but it should do for what I am using it for.

- Storing the strings in a custom .properties file.

I'm actually using this to keep track of Podcasts that have been downloaded and imported into Sage's library.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
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
Viewing imported videos in the SageTV Recordings area galeo SageTV Customizations 22 12-24-2007 08:34 PM
Viewing Imported VIdeos by folder name? kelemvor SageTV Software 6 02-17-2007 01:54 PM
Please let me export my ratings/viewing-history. TedHoward SageTV Software 1 02-28-2005 03:13 AM


All times are GMT -6. The time now is 06:08 PM.


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