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 08-28-2008, 05:37 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
AlbumID

According to the API's doc, there is no AlbumID in the AlbumAPI... Yet albums with the same name but different contents are treated separately, so obviously the Wiz.bin is using a unique key for those, but the API simply isn't exposing it. So any idea if there is any way to get to it? I tried to use ToString() on an album object, but it in wasn't there...
Reply With Quote
  #2  
Old 08-28-2008, 06:20 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
Easiest way is to look in the Stock STV and see how it tells them apart.
Reply With Quote
  #3  
Old 08-28-2008, 07:33 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by stanger89 View Post
Easiest way is to look in the Stock STV and see how it tells them apart.
Thanks, technically I can use GetAlbums to get distinct albums, then group them by genre or artist. But getting them is not the problem...

So here's the motivation: I am developing a plugin for MainLobby which for efficiency reason basically needs its own database, using the relevant parts of SageTV's database for the Media Centre (i.e. Photos/Music/Videos). By using the MediaFileID of the photos/songs/videos as the primary key of the plugin's database, I ensure a 1:1 correspondence and it makes for easy updates. So the problem is that the Albums have no exposed ID, so while I can create arbitrary primary keys for the Albums table, on the next plugin's database update I would have to check the whole record, instead of just the primary key like for the other tables...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #4  
Old 08-28-2008, 08:26 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Can't you use a MediaFileID as a surrogate?

albumID = album.GetAlbumTracks()[0].GetMediaFileForAiring().GetMediaFileID()

album = mediaFileAPI.GetMediaFileForID(albumID).GetAlbumForFile()

So long as you know that what you have in your hand is meant to be an AlbumID (and there are no empty albums), this ought to work.
__________________
-- Greg
Reply With Quote
  #5  
Old 08-28-2008, 08:34 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by GKusnick View Post
So long as you know that what you have in your hand is meant to be an AlbumID (and there are no empty albums), this ought to work.
Thanks, I like that idea! Might be a small glitch if a songs gets added back and end up as a new track[0], but I can live with that and a full rebuild would fix it anyway.
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #6  
Old 08-31-2008, 08:07 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by GKusnick View Post
album = mediaFileAPI.GetMediaFileForID(albumID).GetAlbumForFile()
This method has been working great for my needs!

OTOH, if I try to add that reconstructed album to a playlist {playlist.AddToPlaylist(album)}, nothing happens. I tried unwrapping album first, but that didn't work either. From album.GetAlbumName() I know that I have a proper album and the documentation says we can add an album to the playlist, which also happens to be how the STV adds it... Currently I have to loop and add individual songs from the album, but I would prefer to avoid that. Any ideas?
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
  #7  
Old 08-31-2008, 08:27 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Not seeing any obvious reason why it wouldn't work. Have you checked the debug log for error messages?
__________________
-- Greg
Reply With Quote
  #8  
Old 08-31-2008, 08:54 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by GKusnick View Post
Have you checked the debug log for error messages?
Yes, there was nothing special in the log. I guess I'll try something else.

EDIT: And now it started working using the unwrap method... Maybe I forgot to copy the .jar file when I tried it before...
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad

Last edited by Fonceur; 08-31-2008 at 09:37 PM.
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:30 AM.


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