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


Java IMediaResource类代码示例

本文整理汇总了Java中sagex.phoenix.vfs.IMediaResource的典型用法代码示例。如果您正苦于以下问题:Java IMediaResource类的具体用法?Java IMediaResource怎么用?Java IMediaResource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IMediaResource类属于sagex.phoenix.vfs包,在下文中一共展示了IMediaResource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
private void run() {
	if (watchDir!=null) {
		log.info("Watching DIR " + watchDir  + " for newly added files to rename");
		try {
			new WatchDir(Paths.get(watchDir.toURI()), true).processEvents(new WatchedFile(this));
		} catch (IOException e) {
			log.error("Failed to watch dir " + watchDir, e);
		};
	} else {		
		for (File f : files) {
			if (!f.exists()) {
				log.debug("Invalid file: " + f);
				continue;
			}

			IMediaResource res = FileResourceFactory.createResource(f);
			processResource(res);
		}
	}
}
 
开发者ID:stuckless,项目名称:phoenix-renamer,代码行数:21,代码来源:PhoenixRenamer.java

示例2: SetFocus

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public boolean SetFocus(Object Item, Object DefaultItem, Integer DefaultIndex, String TableCell, Boolean Next){
    LOG.debug("SetFocus: *** Next '" + Next + "' DefaultIndex '" + DefaultIndex + "' TableCell '" + TableCell + "' DefaultItem '" + DefaultItem + "' Item '" + Item + "'");
    IMediaResource imr = Source.ConvertToIMR(Item);
    if (imr==null){
        LOG.debug("SetFocus: null Item passed in - so using Defaults");
        return SetFocus(util.OptionNotFound, DefaultItem, DefaultIndex, TableCell);
    }
    String Key = "";
    if (Next==null){
        Key = phoenix.media.GetPath(phoenix.umb.GetParent(imr));
    }else if (Next){
        //determine the Key for the Next item
        Key = phoenix.media.GetPath(imr);
    }else{
        //determine the Key for the Previous item
        Key = phoenix.media.GetPath(phoenix.umb.GetParent(phoenix.umb.GetParent(imr)));
    }
    if (TableCell==null){
        TableCell = TableCell(Key);
    }
    return SetFocus(Key, DefaultItem, DefaultIndex, TableCell);
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:23,代码来源:HistoryCache.java

示例3: PropertyListContainsBase

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Boolean PropertyListContainsBase(Boolean bFlow, String PropSection, String PropName, ViewFolder Folder){
    String tProp = "";
    tProp = FormatProp(bFlow,PropSection,PropName);
    List<String> tList = GetPropertyAsList(tProp);
    if (tList.size()>0){
        for (IMediaResource Child: Folder.getChildren()){
            String NewValue = Child.getTitle();
            if (tList.contains(NewValue)){
                return Boolean.TRUE;
            }
        }
        return Boolean.FALSE;
    }else{
        return Boolean.FALSE;
    }
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:17,代码来源:util.java

示例4: SeriesNewLastNext

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public SeriesNewLastNext(List ChildList){
    LOG.debug("NewLastNext List passed in '" + ChildList + "'");
    //check to ensure this is a list of IMediaResource items
    if (!ChildList.isEmpty()){
        if (ChildList.get(0) instanceof IMediaResource){
            this.childList = ChildList;
        }else{
            LOG.debug("NewLastNext List does NOT contain IMR objects - converting to IMR");
            this.childList = new ArrayList();
            for (Object objTemp: ChildList){
                //LOG.debug("NewLastNext Adding Object '" + objTemp + "'");
                //LOG.debug("NewLastNext Adding IMR '" + phoenix.media.GetMediaResource(objTemp) + "'");
                this.childList.add(phoenix.media.GetMediaResource(objTemp));
                //LOG.debug("NewLastNext Added.");
            }
        }
    }
    Create();
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:20,代码来源:SeriesNewLastNext.java

示例5: GetArtifact

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Object GetArtifact(IMediaResource imediaresource, String resourcetype, String RefreshArea, Boolean originalSize, Boolean ForceSeries){
        //return the default image passed in when none found or waiting for background processing from the queue
        LOG.debug("GetArtifact: ***** START GetArtifact for '" + resourcetype + "' imediaresource '" + imediaresource + "' RefreshArea '" + RefreshArea + "' originalSize '" + originalSize + "'");
        if (imediaresource == null) {
            LOG.debug("GetArtifact: imediaresource is NULL so returning NULL");
            return null;
        }

        ImageCacheKey tKey = GetImageKey(imediaresource, resourcetype, originalSize, null, ForceSeries);
        if (!tKey.IsValidKey()){
            LOG.debug("GetArtifact: Not a valid Key so returning defaultimage '" + tKey + "'");
//            return tKey.getDefaultImage();
            return "USE:DEFALUT";
        }
        tKey.setRefreshArea(RefreshArea);
        LOG.debug("GetArtifact: calling GetImage with tKey '" + tKey + "'");
        return GetImage(tKey);
    }
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:19,代码来源:ImageCache.java

示例6: GetImage

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Object GetImage(IMediaResource imediaresource, String resourcetype, Boolean originalSize, String defaultImage){
    //return the default image passed in when none found or waiting for background processing from the queue
    //LOG.debug("GetImage: imediaresource '" + imediaresource + "' resourcetype '" + resourcetype + "' defaultImage '" + defaultImage + "'");
    if (imediaresource == null) {
        LOG.debug("GetImage: imediaresource is NULL so returning NULL");
        return null;
    }

    ImageCacheKey tKey = GetImageKey(imediaresource, resourcetype, originalSize, defaultImage);
    //store the mediakey to be used for refresh
    if (!tKey.IsValidKey()){
        LOG.debug("GetImage: Not a valid Key so returning defaultimage '" + tKey + "'");
        return tKey.getDefaultImage();
    }
    tKey.setRefreshKey(GetMediaKey(imediaresource));
    return GetImage(tKey);
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:18,代码来源:ImageCache.java

示例7: IsChildTV

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Boolean IsChildTV(IMediaResource imediaresource){
    if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
        IMediaResource childmediaresource = null;
        childmediaresource = ImageCache.GetChild(imediaresource, Boolean.FALSE);
        if (childmediaresource==null){
            //LOG.debug("IsChildTV: null for first child");
            return Boolean.FALSE;
        }
        if (phoenix.media.IsMediaType( childmediaresource , "TV" )){
            //LOG.debug("IsChildTV: First child is a TV item '" + childmediaresource + "'");
            return Boolean.TRUE;
        }
    }else{
        //LOG.debug("IsChildTV: not a FOLDER");
        return Boolean.FALSE;
    }
    //LOG.debug("IsChildTV: no TV child item found");
    return Boolean.FALSE;
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:20,代码来源:Source.java

示例8: GetTVIMediaResource

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static IMediaResource GetTVIMediaResource(Object imediaresource){
    if (imediaresource==null){
        LOG.debug("GetTVIMediaResource: null passed in");
        return null;
    }
    if (imediaresource.toString().contains("BlankItem")){
        return null;
    }
    IMediaResource IMR = ConvertToIMR(imediaresource);
    String specialType = GetSpecialType(IMR);
    if ("series".equals(specialType) || "season".equals(specialType)){  //only valid for series or season
        //LOG.debug("GetTVIMediaResource: returning child for type '" + specialType + "'");
        return ImageCache.GetChild(IMR, Boolean.FALSE);
    }else if ("tv".equals(specialType) || "airing".equals(specialType) || "recording".equals(specialType)){
        //LOG.debug("GetTVIMediaResource: type '" + specialType + "' returning '" + IMR + "'");
        return IMR;
    }
    return null;
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:20,代码来源:Source.java

示例9: GetGenresasString

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static String GetGenresasString(IMediaResource MediaObject, String Separator){
    String Value = "";
    IMediaResource imediaresource = MediaObject;
    if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
        imediaresource = ImageCache.GetChild(imediaresource, Boolean.FALSE);
    }
    if (imediaresource==null){
        return Value;
    }
    List<String> ListValue = phoenix.metadata.GetGenres(imediaresource);
    if (ListValue.size()>0){
        for (String ListItem : ListValue){
            if (ListItem.equalsIgnoreCase("movie")||ListItem.equalsIgnoreCase("film")||ListItem.equalsIgnoreCase("")){
                //skip these
            }else{
                if (Value.equals("")){
                    Value = ListItem;
                }else{
                    Value = Value + Separator + ListItem;
                }
            }
            //LOG.debug("GetGenresasString: checked '" + ListItem + "' result '" + Value + "'");
        }
    }
    return Value;
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:27,代码来源:MetadataCalls.java

示例10: IsCurrentlyRecording

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Boolean IsCurrentlyRecording(Object IMR){
    IMediaResource imediaresource = Source.ConvertToIMR(IMR);
    if (imediaresource==null){
        return Boolean.FALSE;
    }else{
        if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
            ViewFolder Folder = (ViewFolder) imediaresource;
            List Children = phoenix.media.GetAllChildren(Folder);
            //see if any children are being recorded
            Integer Count = sagex.api.Utility.Size(sagex.api.Utility.GetSubgroup(sagex.api.Database.GroupByMethod(Children,"Gemstone_MetadataCalls_IsFileCurrentlyRecording"),true));
            //LOG.debug("IsCurrentlyRecording: FOLDER - Recording '" + Count + "' of '" + Children.size() + "' Items");
            if (Count>0){
                return Boolean.TRUE;
            }else{
                return Boolean.FALSE;
            }
        }else{
            return sagex.api.MediaFileAPI.IsFileCurrentlyRecording(imediaresource.getMediaObject());
        }
    }
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:22,代码来源:MetadataCalls.java

示例11: GetAiredYear

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static String GetAiredYear(Object IMR){
    IMediaResource imediaresource = Source.ConvertToIMR(IMR);
    if (imediaresource!=null){ 
        if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
            //get the range of years
            ViewFolder Folder = (ViewFolder) imediaresource;
            Object[] tList = (Object[]) sagex.api.Database.Sort(phoenix.media.GetAllChildren(Folder), false, "phoenix_metadata_GetOriginalAirDate");
            String firstYear = getAiredYear((IMediaResource)tList[0]);
            String lastYear = getAiredYear((IMediaResource)tList[tList.length-1]);
            if (firstYear.equals(lastYear)){
                return "Aired in " + firstYear;
            }else{
                return "Aired " + firstYear + " - " + lastYear;
            }
        }else{
            //LOG.debug("GetAiredYear: Not a folder so returning getAiredYear(imediaresource)");
            return "Aired in " + getAiredYear(imediaresource);
        }
    }
    return "";
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:22,代码来源:MetadataCalls.java

示例12: IsWatched

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Boolean IsWatched(Object IMR){
    IMediaResource imediaresource = Source.ConvertToIMR(IMR);
    if (imediaresource!=null){ 
        if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
            //see if ALL the Children are watched by seeing if we find any unwatched ones
            ViewFolder Folder = (ViewFolder) imediaresource;
            List Children = phoenix.media.GetAllChildren(Folder);
            //Object[] tList = (Object[]) sagex.api.Database.Sort(Children, true, "phoenix_metadata_GetOriginalAirDate");
            //Get all the Watched items
            Integer WatchedCount = sagex.api.Utility.Size(sagex.api.Utility.GetSubgroup(sagex.api.Database.GroupByMethod(Children,"phoenix_media_IsWatched"),true));
            //LOG.debug("IsWatched: FOLDER - Watched '" + WatchedCount + "' of '" + Children.size() + "' Items");
            if (Children.size()==WatchedCount){
                return Boolean.TRUE;
            }
        }else{
            return imediaresource.isWatched();
        }
    }
    return Boolean.FALSE;
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:21,代码来源:MetadataCalls.java

示例13: ChangeWatched

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static void ChangeWatched(Object IMR, Boolean Value){
    IMediaResource imediaresource = Source.ConvertToIMR(IMR);
    if (imediaresource!=null){ 
        if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
            //see if ALL the Children are watched by seeing if we find any unwatched ones
            ViewFolder Folder = (ViewFolder) imediaresource;
            for (Object child:phoenix.media.GetAllChildren(Folder)){
                if (child instanceof IMediaResource){
                    IMediaResource iChild = (IMediaResource) child;
                    iChild.setWatched(Value);
                }
            }
        }else{
            //LOG.info("***BEFORE***SETWATCHED*** getLastWatchedTimeStamp = '" + GetLastWatchedTimeStamp(imediaresource) + "' W = '" + imediaresource.isWatched() + "'");
            imediaresource.setWatched(Value);
            //LOG.info("***AFTER ***SETWATCHED*** getLastWatchedTimeStamp = '" + GetLastWatchedTimeStamp(imediaresource) + "' W = '" + imediaresource.isWatched() + "'");
        }
    }
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:20,代码来源:MetadataCalls.java

示例14: GetLastWatchedTimeStamp

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static long GetLastWatchedTimeStamp(IMediaResource o) {
    if (o instanceof IMediaFile) {
        Object theairing = o.getMediaObject();
        Object thisAiring = phoenix.media.GetMediaObject(theairing);
        //LOG.debug("IMediaFile found - realwatched from thisAiring '" + AiringAPI.GetRealWatchedStartTime(thisAiring) + "' for S" + phoenix.metadata.GetSeasonNumber(thisAiring) + "E" + phoenix.metadata.GetEpisodeNumber(thisAiring));
        return AiringAPI.GetRealWatchedStartTime(thisAiring);
    }

    if (o instanceof IMediaFolder) {
        //LOG.debug("IMediaFolder found - searching");
        return searchFolderForLastWatchedTimeStamp((IMediaFolder) o);
    }

    // If it's not a File or Folder just return a 0
    //LOG.debug("Neither found - class is '" + o.getClass() + "'");
    return 0;
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:18,代码来源:MetadataCalls.java

示例15: IsArchived

import sagex.phoenix.vfs.IMediaResource; //导入依赖的package包/类
public static Boolean IsArchived(Object IMR){
    IMediaResource imediaresource = Source.ConvertToIMR(IMR);
    if (imediaresource!=null){ 
        if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
            //see if ALL the Children are archived by seeing if we find any unarchived ones
            ViewFolder Folder = (ViewFolder) imediaresource;
            List Children = phoenix.media.GetAllChildren(Folder);
            //Get all the Archived items
            Integer ArchivedCount = sagex.api.Utility.Size(sagex.api.Utility.GetSubgroup(sagex.api.Database.GroupByMethod(Children,"phoenix_media_isLibraryFile"),true));
            if (Children.size()==ArchivedCount){
                return Boolean.TRUE;
            }
        }else{
            return imediaresource.isLibraryFile();
        }
    }
    return Boolean.FALSE;
}
 
开发者ID:jusjoken,项目名称:gemstone2,代码行数:19,代码来源:MetadataCalls.java


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