private function getBaseMoverStack(Id3Metadata $id3Metadata) { $mms = new MediaMoveStack($id3Metadata); if ($this->input->getOption('dump-command')) { $mms->setBuildNativeCommand(true); } if ($this->input->getOption('remove-empty-dir')) { $mms->setRemoveParentDirIfEmpty(true); } return $mms; }
/** * @throws \Exception */ public function testFileGenreRule() { $mediaInfoWrapper = Helper::getMedianfoWrapper(); $id3meta = \Sapar\Mfo\Test\Helper::getId3Metadata(\Sapar\Mfo\Test\Helper::getSampeMp3File()); $mediaInfoWrapper->read($id3meta); $mediaMove = new MediaMoveStack($id3meta); $moveResult = $mediaMove->reset()->pathAddMediaGenre()->pathAddMediaYear()->pathAddFileMonth()->moveIn(__DIR__ . '/..//'); $this->assertEquals(true, $moveResult); $this->assertEquals(true, $moveResult); $this->assertContains('Celtic', $mediaMove->getTargetDest()->__toString()); $this->assertContains('2003', $mediaMove->getTargetDest()->__toString()); rename($mediaMove->getTargetDest(), Helper::getSampeMp3File()); rmdir($mediaMove->getTargetDest()->getPath()); }