本文整理汇总了Java中sagex.phoenix.vfs.IMediaFile.getAlbumInfo方法的典型用法代码示例。如果您正苦于以下问题:Java IMediaFile.getAlbumInfo方法的具体用法?Java IMediaFile.getAlbumInfo怎么用?Java IMediaFile.getAlbumInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sagex.phoenix.vfs.IMediaFile
的用法示例。
在下文中一共展示了IMediaFile.getAlbumInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveMediaTitle
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
private String resolveMediaTitle(String mediaTitle, IMediaFile mf) {
if (mf == null)
return mediaTitle;
if (!StringUtils.isEmpty(mediaTitle))
return mediaTitle;
// check for music
if (mf.isType(MediaResourceType.MUSIC.value())) {
IAlbumInfo info = mf.getAlbumInfo();
if (info != null) {
mediaTitle = info.getArtist();
}
if (!StringUtils.isEmpty(mediaTitle))
return mediaTitle;
}
IMetadata md = mf.getMetadata();
if (md != null) {
mediaTitle = md.getMediaTitle();
if (StringUtils.isEmpty(mediaTitle))
mediaTitle = null;
}
return Utils.returnNonNull(mediaTitle, mf.getTitle());
}
示例2: resolveFanartArtifactTitle
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
private String resolveFanartArtifactTitle(MediaArtifactType artifactType, String artifactTitle, IMediaFile mf) {
if (!StringUtils.isEmpty(artifactTitle))
return artifactTitle;
if (artifactType == MediaArtifactType.ALBUM) {
IAlbumInfo info = mf.getAlbumInfo();
if (info != null) {
artifactTitle = info.getName();
}
}
return artifactTitle;
}
示例3: createSageFriendlyQuery
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
/**
* Most resources are Sage Resources, so this attempts to first create a
* query using the existing Sage Resource to fill in the title, year,
* episode title, etc.
* <p/>
* If the resource is a recording, airing, or already has a MediaType, then
* it will simply use the existing metadata from the object as the query.
* Otherwise it will do a scraped query.
*
* @param res
*/
public SearchQuery createSageFriendlyQuery(IMediaFile res, Hints hints) {
SearchQuery q = null;
if (res.isType(MediaResourceType.MUSIC.value())) {
q = new SearchQuery(hints);
IAlbumInfo info = res.getAlbumInfo();
if (info != null) {
q.set(Field.RAW_TITLE, res.getTitle());
q.set(Field.ARTIST, info.getArtist());
q.set(Field.ALBUM, info.getName());
q.setMediaType(MediaType.MUSIC);
}
} else if (hints.getBooleanValue(MetadataHints.KNOWN_RECORDING, false) || res.isType(MediaResourceType.RECORDING.value())
|| res.isType(MediaResourceType.EPG_AIRING.value())) {
if (MetadataUtil.isImportedRecording(res)) {
// these were non sage recordings, that we imported, so we'll do
// a full scape.
q = createQueryFromFilename(res, hints);
} else {
// do a clean query
q = createQueryFromExistingMetadata(res, hints);
}
} else {
// do a normal scraped query
q = createQueryFromFilename(res, hints);
}
return q;
}
示例4: newMediaFile
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
SyncMediaFile newMediaFile(Object m) {
SyncMediaFile smf = new SyncMediaFile();
IMediaFile imf = phoenix.media.GetMediaFile(m);
smf.ID = MediaFileAPI.GetMediaFileID(m);
smf.Title = imf.getTitle();
smf.Description = imf.getMetadata().getDescription();
if (imf.isWatched()) {
smf.Watched = true;
} else {
smf.WatchedDuration = imf.getWatchedDuration();
}
IMetadata md = imf.getMetadata();
if (imf.isType(MediaResourceType.TV.value())) {
smf.Type = "T";
smf.EpisodeName = md.getEpisodeName();
smf.SeasonNumber = md.getSeasonNumber();
smf.EpisodeNumber = md.getEpisodeNumber();
if (md.getOriginalAirDate() != null) {
smf.OriginalAirDate = md.getOriginalAirDate().getTime();
}
if (md.getAiringTime() != null) {
smf.AiringTime = md.getAiringTime().getTime();
}
} else if (imf.isType(MediaResourceType.HOME_MOVIE.value())) {
smf.Type = "H";
} else if (imf.isType(MediaResourceType.ANY_VIDEO.value())) {
smf.Type = "V";
smf.Year = md.getYear();
smf.RunningTime = md.getRunningTime();
} else if (imf.isType(MediaResourceType.MUSIC.value())) {
smf.Type = "M";
IAlbumInfo info = imf.getAlbumInfo();
if (info != null) {
smf.Artist = info.getArtist();
smf.Album = info.getName();
}
} else if (imf.isType(MediaResourceType.PICTURE.value())) {
smf.Type = "P";
} else {
smf.Type = "O";
}
if (imf.isType(MediaResourceType.RECORDING.value())) {
smf.IsRecording = true;
}
if ("V".equals(smf.Type)) {
if (imf.isType(MediaResourceType.BLURAY.value())) {
smf.DiscType = "B";
} else if (imf.isType(MediaResourceType.DVD.value())) {
smf.DiscType = "D";
}
}
return smf;
}