Package de.sosd.mediaserver.util

Examples of de.sosd.mediaserver.util.ScanContext


            didlDao.setOnline(sfd.getId(), true);
            system.increaseUpdateId();
          }
         
          sfd.setScanState(ScanFolderState.SCANNING);
          scanContexts.add(new ScanContext(sfd.getId(), dir));
        }
      }
    }   
    this.systemDao.store(system);
   
View Full Code Here


      for (String id : allDidlIds) {
        touchedDidlMap.addDidl(id, null);
      }
      for (final ScanFolderDomain sfd : system.getScanFolder()) {
        if (idScanContextMap.containsKey(sfd.getId())) {
          final ScanContext sc = idScanContextMap.get(sfd.getId());
          logger.info("scanner [filter] "+sc.getScanFolder());
          for (final ScanFile f : sc.getFiles()) {
            final FileDomain fd = new FileDomain(f.getId(), null, f.getFile());         
            if (this.didl.createDidl(fd, f, touchedDidlMap, sfd)) {
              sc.getMediaFiles().add(fd);
            }
          }
          logger.info("scanner [found new files] " + sc.getMediaFiles().size() + " " +sc.getScanFolder());
        }
      } 
    }
     
    // update folders
    for (final ScanFolderDomain sfd : system.getScanFolder()) {
      if (idScanContextMap.containsKey(sfd.getId())) {
        final ScanContext sc = idScanContextMap.get(sfd.getId());
        boolean changedFiles = false;
        for (final FileDomain fd : sc.getMediaFiles()) {   
          changedFiles |= sfd.addFile(fd);
          logger.info("scanner [add file] " + fd.getName() + "\t\t(" + fd.getPath() + ")");
        }       
        if (changedFiles || !sc.getDeletedMediaFiles().isEmpty()) {
          changedFiles |= updateDidl(sfd.getDidlRoot(), sfd, touchedDidlMap,sc.getDeletedMediaFiles(), itemsToPurge);
        }
        // remove scanfolder mark
        sfd.setScanState(ScanFolderState.IDLE);
        sfd.setLastScan(new Date());
       
View Full Code Here

TOP

Related Classes of de.sosd.mediaserver.util.ScanContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.