本文整理汇总了Java中sagex.phoenix.vfs.IMediaFile.setLibraryFile方法的典型用法代码示例。如果您正苦于以下问题:Java IMediaFile.setLibraryFile方法的具体用法?Java IMediaFile.setLibraryFile怎么用?Java IMediaFile.setLibraryFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sagex.phoenix.vfs.IMediaFile
的用法示例。
在下文中一共展示了IMediaFile.setLibraryFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitFile
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
@Override
public boolean visitFile(IMediaFile res, IProgressMonitor monitor) {
res.setLibraryFile(archivedState);
incrementAffected();
return true;
}
示例2: importMediaFileAsRecording
import sagex.phoenix.vfs.IMediaFile; //导入方法依赖的package包/类
/**
* Imports a mediafile as a Recording so that it will show up in the Sage
* Recordings.
* <p/>
* This will handle importing Movies and TV shows into the recordings area.
*
* @param file
*/
public boolean importMediaFileAsRecording(IMediaFile file) {
try {
if (file.isType(MediaResourceType.RECORDING.value())) {
log.warn("Cannot import as recording. MediaFile is already a Recording.");
return false;
}
if (file.isType(MediaResourceType.VIDEODISC.value())) {
log.warn("Cannot import DVD or Bluray Discs as Recordings");
return false;
}
IMetadata md = file.getMetadata();
String showId = md.getExternalID();
if (file.isType(MediaResourceType.TV.value())) {
if (md.getDiscNumber() > 0) {
showId = createShowId("EP", String.format("EPmt%sS%02dD%02d", md.getMediaProviderDataID(),
md.getSeasonNumber(), md.getDiscNumber()));
} else {
showId = createShowId(
"EP",
String.format("EPmt%sS%02dE%02d", md.getMediaProviderDataID(), md.getSeasonNumber(),
md.getEpisodeNumber()));
}
} else if (file.isType(MediaResourceType.ANY_VIDEO.value())) {
showId = createShowId("MV", String.format("MVmt%sD%02d", md.getMediaProviderDataID(), md.getDiscNumber()));
} else {
log.warn("Can't Import Media as Recording; Invalid Type: " + file);
return false;
}
if (showId == null) {
log.warn("Did not create a show id???: " + file);
return false;
}
if (showId.equals(md.getExternalID())) {
log.warn("ShowID didn't change???: " + file);
return false;
}
// now check to see if this show id is in use...
Object sagemf = ShowAPI.GetShowForExternalID(showId);
if (sagemf != null) {
log.warn("Cannot import recording, since the showid already exists: " + showId + ": " + file);
return false;
}
// import as recording...
md.setExternalID(showId);
// check if we should be updating the archived flag
// by default imported recordings are archived
if (!config.getArchiveRecordings()) {
file.setLibraryFile(false);
}
log.info("Imported MediaFile as Recording: " + file);
return true;
} catch (Throwable t) {
log.warn("Failed to import media item as tv for some unknown reason!", t);
return false;
}
}