diff --git a/library/Class/WebService/OPDS/CatalogEntry.php b/library/Class/WebService/OPDS/CatalogEntry.php index cc59fd3328a242dd5537fc0a05814292763e33b8..e102b50e73f585dbfe8e2656474a08db9bd46dac 100644 --- a/library/Class/WebService/OPDS/CatalogEntry.php +++ b/library/Class/WebService/OPDS/CatalogEntry.php @@ -54,8 +54,10 @@ class Class_WebService_OPDS_CatalogEntry { public function import() { - $category = Class_AlbumCategorie::getLoader()->newInstance() - ->setLibelle(sprintf('import opds du %s', date('d M Y'))); + $libelle = sprintf('import opds du %s', date('d M Y')); + if (!$category = Class_AlbumCategorie::getLoader()->findFirstBy(array('libelle' => $libelle))) + $category = Class_AlbumCategorie::getLoader()->newInstance()->setLibelle($libelle); + $category->save(); $album = Class_Album::getLoader()->newInstance()