当前位置: 首页>>代码示例>>Java>>正文


Java IMediaFile.setLibraryFile方法代码示例

本文整理汇总了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;
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:7,代码来源:ArchiveVisitor.java

示例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;
    }
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:74,代码来源:MetadataManager.java


注:本文中的sagex.phoenix.vfs.IMediaFile.setLibraryFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。