本文整理汇总了Java中sagex.phoenix.vfs.IMediaFile.getTitle方法的典型用法代码示例。如果您正苦于以下问题:Java IMediaFile.getTitle方法的具体用法?Java IMediaFile.getTitle怎么用?Java IMediaFile.getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sagex.phoenix.vfs.IMediaFile
的用法示例。
在下文中一共展示了IMediaFile.getTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findLibrary
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
private IMediaResource findLibrary(IMediaFolder library, IMediaFile toFind) {
String toFindSong = toFind.getTitle();
for (IMediaResource r : library) {
if (r instanceof IMediaFile) {
String song = r.getTitle();
float score = MetadataSearchUtil.calculateScore(song, toFindSong);
if (score > .95) {
return r;
}
}
}
return null;
}
示例2: visitFile
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
@Override
public boolean visitFile(IMediaFile res, IProgressMonitor monitor) {
String name = res.getTitle();
if (name != null) {
name = name.toLowerCase();
if (name.contains(titleContains)) {
addTo.add(res);
return true;
}
}
if (res.isType(MediaResourceType.TV.value())) {
// check episode name
IMetadata md = res.getMetadata();
if (md == null)
return false;
name = md.getEpisodeName();
if (name != null) {
name = name.toLowerCase();
if (name.contains(titleContains)) {
addTo.add(res);
return true;
}
}
}
return false;
}
示例3: SetFanartArtifact
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
private void SetFanartArtifact(Object mediaObject, File fanart, MediaType mediaType, String mediaTitle,
MediaArtifactType artifactType, String artifactTitle, Map<String, String> metadata) {
IMediaFile mf = phoenix.media.GetMediaFile(mediaObject);
mediaObject = sage(mediaObject);
if (mf == null || mediaObject == null) {
return;
}
mediaType = resolveMediaType(mediaType, mf);
metadata = resolveFanartMetadata(metadata, mediaType, mf);
mediaTitle = mf.getTitle();
// check if the Metadata has SEASON specific data and handle differently
Boolean isTVSeason = Boolean.FALSE;
if (metadata != null) {
if (metadata.containsKey(FanartUtil.SEASON_NUMBER)) {
isTVSeason = Boolean.TRUE;
}
}
try {
if (!(api instanceof IHasCentralizedFanart)) {
log.warn("SetFanartArtifact only valid for central fanart implementations");
}
String central = (new File(GetFanartCentralFolder())).getCanonicalPath();
String file = fanart.getCanonicalPath();
if (!file.startsWith(central)) {
throw new Exception("You can only set a fanart artifact relative to the fanart folder. Folder: " + central
+ "; fanart: " + file);
}
String art = file.substring(central.length());
if (art.startsWith(File.separator)) {
art = StringUtils.strip(art, File.separator);
}
// for tv series, store it against the series name
if (isTVSeason) {
// special handling for SEASON Defaults
String SeasonNumber = metadata.get(FanartUtil.SEASON_NUMBER);
String SeasonTitle = resolveMediaSeasonTitle(mediaTitle, SeasonNumber);
log.debug("SetFanartArtifact: using special TV SEASON logic for '" + SeasonTitle + "'");
UserRecordUtil.setField(STORE_SEASON_FANART, SeasonTitle, artifactType.name(), file);
} else if (mf.isType(MediaResourceType.TV.value())) {
// tv without season information
UserRecordUtil.setField(STORE_SERIES_FANART, mediaTitle, artifactType.name(), file);
} else {
String key = null;
if (artifactType == MediaArtifactType.POSTER) {
key = ISageCustomMetadataRW.FieldName.DEFAULT_POSTER;
} else if (artifactType == MediaArtifactType.BACKGROUND) {
key = ISageCustomMetadataRW.FieldName.DEFAULT_BACKGROUND;
} else if (artifactType == MediaArtifactType.BANNER) {
key = ISageCustomMetadataRW.FieldName.DEFAULT_BANNER;
}
if (key == null)
throw new Exception("Invalid Artifact Type: " + artifactType + "; Can't set default artifact.");
MediaFileAPI.SetMediaFileMetadata(mediaObject, key, art);
}
} catch (Exception e) {
log.warn("Failed to set the default fanart artifact!", e);
}
// caches need to be cleared so that we can pick up the changes
ClearMemoryCaches();
}
示例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;
}