fix: some fixes
This commit is contained in:
parent
4976f1cac9
commit
6c90845c4c
6 changed files with 82 additions and 9 deletions
54
app/Console/Commands/ResendArcadiaLinkMedias.php
Normal file
54
app/Console/Commands/ResendArcadiaLinkMedias.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Lib\ArcadiaLinkUtilities;
|
||||
use App\Models\ArcadiaLink;
|
||||
use App\Models\Media;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ResendArcadiaLinkMedias extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'medias:resend-aracadia-links';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Resend files to Arcadia after Arcadia Link fix';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// FIXME : Variabiliser la date
|
||||
//$al = ArcadiaLink::where('created_at', '>=', '2025-10-23')->get();
|
||||
|
||||
foreach ($al as $error)
|
||||
{
|
||||
$media = Media::withTrashed()->find($error->media_id);
|
||||
|
||||
if ($error->arcadia_id === 0) {
|
||||
|
||||
ArcadiaLinkUtilities::create($media);
|
||||
} else {
|
||||
if (is_null($media->deleted_at)) {
|
||||
ArcadiaLinkUtilities::update($media);
|
||||
} else {
|
||||
ArcadiaLinkUtilities::delete($media);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ class UploadController extends Controller
|
|||
'File guessed extensions :guessedExts does not match file name extension :extension',
|
||||
[
|
||||
'guessedExt' => $guessedExts,
|
||||
'extension' => $mediaExtension,
|
||||
'extension' => $mediaExtension->value,
|
||||
]
|
||||
)
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -267,8 +267,6 @@ class Media extends Model
|
|||
|
||||
/** @throws \RuntimeException */
|
||||
$model->removeFromElasticSearch();
|
||||
|
||||
$model->deleteFilesOnAllPath();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
if (
|
||||
in_array(config('app.env'), ['local', 'testing']) && config('app.bypassldap') && !app()->runningInConsole()
|
||||
) {
|
||||
Auth::loginUsingId(1);
|
||||
Auth::loginUsingId(24);
|
||||
}
|
||||
|
||||
// !!! Fuc**** Lab LDC exception OMG !!!
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- < XSD deviné, basé sur la BDD et cette seule affirmation "les 3 champs sont obligatoires" @author Jérémy Munsch jeremy.munsch@ldc.fr > -->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:element name="MEDIA_VISUEL">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="codeArcadia" type="_positive_unsigned_integer_without_leading_zeros" />
|
||||
<xs:element name="code_DAM" type="_positive_unsigned_integer_without_leading_zeros"/>
|
||||
<xs:element name="version" type="_positive_unsigned_integer_without_leading_zeros"/>
|
||||
<xs:element name="version" minOccurs="1" nillable="true" >
|
||||
<xs:simpleType>
|
||||
<xs:union memberTypes="_positive_unsigned_integer_without_leading_zeros xs:string"/>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
|
@ -16,5 +18,4 @@
|
|||
<xs:pattern value="[123456789]\d*"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
</xs:schema>
|
||||
</xs:schema>
|
||||
20
resources/documents/arcadia/incoming_medias.xsd.ok_keep
Normal file
20
resources/documents/arcadia/incoming_medias.xsd.ok_keep
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- < XSD deviné, basé sur la BDD et cette seule affirmation "les 3 champs sont obligatoires" @author Jérémy Munsch jeremy.munsch@ldc.fr > -->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:element name="MEDIA_VISUEL">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="codeArcadia" type="_positive_unsigned_integer_without_leading_zeros" />
|
||||
<xs:element name="code_DAM" type="_positive_unsigned_integer_without_leading_zeros"/>
|
||||
<xs:element name="version" type="_positive_unsigned_integer_without_leading_zeros"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:simpleType name="_positive_unsigned_integer_without_leading_zeros">
|
||||
<xs:restriction base="xs:positiveInteger">
|
||||
<xs:pattern value="[123456789]\d*"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
</xs:schema>
|
||||
Loading…
Add table
Reference in a new issue