Exemplo n.º 1
0
 public function testRemoveEmptyIndexes()
 {
     $oldArray = array('', 'index_1', ' ', 'index_3', 'index_4');
     $newArray = TVDB::removeEmptyIndexes($oldArray);
     $this->assertTrue(count($newArray) == 3);
     $this->assertTrue($newArray[0] == 'index_1');
     $this->assertTrue($newArray[1] == 'index_3');
     $this->assertTrue($newArray[2] == 'index_4');
 }
Exemplo n.º 2
0
 public function update()
 {
     // update info + episodes from tvrage
     $tvrage = new TVRage();
     $tvrage->update($this);
     if ($this->tvdb_id == 0) {
         $this->findTVDB();
     }
     if ($this->tvdb_id != 0) {
         // get info from tvdb
         $tvdb = new TVDB();
         $tvdb->update($this);
     }
     // cache images
     $localStore = nzbVR::instance()->localStore;
     $shouldSave = false;
     if ($this->banner != null) {
         $localStore->storeImage("series/banners", TVDB::imageURL($this->banner));
         $shouldSave = true;
     }
     if ($this->poster != null) {
         $localStore->storeImage("series/poster", TVDB::imageURL($this->poster));
         $shouldSave = true;
     }
     if ($this->fanart != null) {
         $localStore->storeImage("series/fanart", TVDB::imageURL($this->fanart));
         $shouldSave = true;
     }
     if ($shouldSave) {
         $localStore->save();
     }
 }