/**
  * @param $file
  * @throws \Exception
  */
 private function doJob($file)
 {
     $this->files++;
     $id3Meta = new Id3Metadata($file);
     $this->mediainfoWrapper->read($id3Meta);
     $mover = $this->getBaseMoverStack($id3Meta);
     $return = $mover->pathAddMediaYear()->pathAddMediaGenre()->moveIn($this->input->getArgument('output-dir'));
     if ($return && !$this->input->getOption('dump-command')) {
         $this->ouput->writeln($mover->getTargetDest()->getRealPath());
         $this->movedFiles++;
         //return;
     }
     $moveToUntagged = $this->input->getOption('move-untagged-to');
     if ($mover->isPartsIsIncomplete() && $moveToUntagged) {
         if (!is_dir($moveToUntagged)) {
             mkdir($moveToUntagged, 0775, true);
         }
         if ($return = $mover->reset()->moveIn($moveToUntagged)) {
             $this->untaggedFiles++;
             //return;
         }
     }
     if ($return && $this->input->getOption('dump-command')) {
         $this->nativeCommandStack[] = $mover->getNativeCommand();
     }
     $this->unMovedFiles++;
 }
 public function testWrite()
 {
     $metaDataFile = new Id3Metadata(Helper::getSampleMp3File());
     $this->assertFalse($this->mediaInfoWrapper->supportWrite($metaDataFile));
     $this->mediaInfoWrapper->write($metaDataFile);
 }
Example #3
0
 /**
  * @group mediainfo-read
  * @throws Exception
  */
 public function testReadMediainfo()
 {
     self::$mediainfo->read(self::$id3meta);
 }