Example #1
0
        public static LibraryCategoryInfo GetCategoryInfoForFile(ICategoryService categoryService, CheckUpdateDto data, int fileId, bool useWeb)
        {
            int catId = GetCategoryIdForFile(categoryService, data, fileId, useWeb);
            LibraryCategoryInfo libraryCategoryInfo = categoryService.GetLibraryCategoryInfo(data, catId, useWeb, false);

            return(libraryCategoryInfo);
        }
Example #2
0
        private bool CheckContentForUpdates(ContentType contentType, DateTime lastModDateUtc, CheckUpdateDto fileInfo)
        {
            bool updatesExist = false;

            if (contentType == ContentType.File)
            {
                LibraryFileInfoEx libraryFileInfoEx = _filesService.GetFileInfo(fileInfo);
                if (libraryFileInfoEx == null)
                {
                    isExcuted = false;
                    return(updatesExist);
                }
                updatesExist = libraryFileInfoEx.LastModDate > lastModDateUtc;

                LibraryCategoryInfo libraryCategoryInfo = Utils.GetCategoryInfoForFile(_categoryService, fileInfo, libraryFileInfoEx.FileId, !libraryFileInfoEx.IsUserFile);
                isLibraryFile = !libraryCategoryInfo.Type.IsUserCategory();
            }
            else
            {
                if (contentType == ContentType.GlobalFavorite)
                {
                    //ContentGroupInfo contentGroupInfo = da.LibrarianRpc.GetContentGroupInfo(contentId);
                    //updatesExist = contentGroupInfo.LastModDate > lastModDateUtc;
                }
                else if (contentType == ContentType.MyFavorite)
                {
                    //VirtualPresentation virtualPresentation = session.LibrarianRpc.GetVirtualPresentation(contentId);
                    //updatesExist = virtualPresentation.CreatedDate > lastModDateUtc;
                }
            }

            return(updatesExist);
        }