Skip to content

Commit

Permalink
Merge branch 'release/1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
IllyaMoskvin committed Sep 8, 2022
2 parents 88caa08 + dde5548 commit 43096a5
Show file tree
Hide file tree
Showing 292 changed files with 3,680 additions and 5,754 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ ELASTICSEARCH_SHARDS_REPLICA=0 # Set to number of nodes - 1
# Open-source data services:
COLLECTIONS_DATA_SERVICE_URL='http://data-service-collections.test/api/v1'
ASSETS_DATA_SERVICE_URL='http://data-service-assets.test/api/v1'
LIBRARY_DATA_SERVICE_URL='http://data-service-library.test/api/v1'
ARCHIVES_DATA_SERVICE_URL='http://data-service-archive.test/api/v1'
DSC_DATA_SERVICE_URL='http://data-service-catalogues.test/api/v1'
SHOP_DATA_SERVICE_URL='http://data-service-shop.test/api/v1'
ANALYTICS_DATA_SERVICE_URL='http://data-service-analytics.test/api/v1'
Expand All @@ -74,7 +72,6 @@ DIGITAL_LABELS_JSON_ROOT=
DIGITAL_LABELS_IMAGE_ROOT=

STATIC_ARCHIVE_JSON='https://raw.githubusercontent.com/art-institute-of-chicago/static-archive/master/archive.json'
PRIMO_API_SOURCE=

SHOP_IMGIX_URL='https://shop-images.imgix.net/'
SHOP_PRODUCT_URL='https://shop.artic.edu/products/'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ https://api.artic.edu/api/v1/artworks

...and here's a query that shows identifiers, titles, and last modified dates for all artworks that have been updated in our collections system in the past seven days from this moment, sorted in reverse chronological order:

https://api.artic.edu/api/v1/artworks/search?fields=id,title,last_updated_source&query[range][last_updated_source][gte]=now-7d&sort[last_updated_source][order]=desc
https://api.artic.edu/api/v1/artworks/search?fields=id,title,source_updated_at&query[range][source_updated_at][gte]=now-7d&sort[source_updated_at][order]=desc

Our API is a wrapper around [Elasticsearch's Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl.html). Depending on your needs, these queries can get quite complex.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4
1.5
4 changes: 2 additions & 2 deletions app/BelongsToManyOrOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function expectMany()
*/
public function isPreferred()
{
return $this->wherePivot('preferred', '=', true)->expectOne();
return $this->wherePivot('is_preferred', '=', true)->expectOne();
}

/**
Expand All @@ -66,6 +66,6 @@ public function isPreferred()
*/
public function isAlternative()
{
return $this->wherePivot('preferred', '=', false)->expectMany();
return $this->wherePivot('is_preferred', '=', false)->expectMany();
}
}
2 changes: 0 additions & 2 deletions app/Console/Commands/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ protected function getCategories()
'Mobile' => 'Mobile',
'Dsc' => 'Digital Scholarly Catalogs',
'StaticArchive' => 'Static Archive',
//'Archive' => 'Archive',
//'Library' => 'Library',
'Web' => 'Website',
];
}
Expand Down
97 changes: 0 additions & 97 deletions app/Console/Commands/Bulk/BulkAll.php

This file was deleted.

18 changes: 0 additions & 18 deletions app/Console/Commands/CleanSeed.php

This file was deleted.

7 changes: 3 additions & 4 deletions app/Console/Commands/Delete/DeleteAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class DeleteAssets extends AbstractImportCommand
{

protected $signature = 'delete:assets
{--since= : How far back to scan for records}';

Expand Down Expand Up @@ -66,10 +65,10 @@ private function shallow()

// Loop through all model types
foreach ($this->modelClasses as $modelClass) {
// Check if a resource with a matching lake_guid exists
if ($model = $modelClass::where('lake_guid', '=', $datum->asset_id)->first()) {
// Check if a resource with a matching id exists
if ($model = $modelClass::where('id', '=', $datum->asset_id)->first()) {
// Check that the resource was modified at or before the delete
if ($model->source_modified_at->lte($sourceDeletedAt)) {
if ($model->source_updated_at->lte($sourceDeletedAt)) {
$this->warn('Deleting ' . $modelClass . ' ' . $datum->asset_id);
$model->delete();
break;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Delete/DeleteCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private function deleteByEndpoint()
}

// Ignore the change the if the record has been modified after the delete
if ($entity->source_modified_at->gt($deletedAt)) {
if ($entity->source_updated_at->gt($deletedAt)) {
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions app/Console/Commands/Dump/DumpExportGettingStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle()
$json = fopen(Storage::disk('dumps')->path('local/getting-started/allArtworks.jsonl'), 'a');

$artworks = $model::query()
->select('citi_id', 'title', 'main_id', 'department_id')
->select('id', 'title', 'main_id', 'department_id')
->setEagerLoads([
'artistPivots',
'categories',
Expand All @@ -61,7 +61,7 @@ public function handle()
foreach ($model::cursor() as $item) {
// JSON
fwrite($json, json_encode([
'id' => $item->citi_id,
'id' => $item->id,
'title' => $item->title,
'main_reference_number' => $item->main_id,
'department_title' => ($item->departments->first()->title ?? null),
Expand All @@ -71,7 +71,7 @@ public function handle()
// CSV
if ($item->isBoosted()) {
$csv->insertOne([
'id' => $item->citi_id,
'id' => $item->id,
'title' => $item->title,
'main_reference_number' => $item->main_id,
'department_title' => ($item->departments->first()->title ?? null),
Expand Down
2 changes: 0 additions & 2 deletions app/Console/Commands/Import/ImportAllCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public function handle()
$this->call('import:events-ticketed-full', ['--yes' => 'default']);
$this->call('import:dsc', ['--yes' => 'default', '-v' => 'default']);
$this->call('import:mobile');
$this->call('import:library', ['--yes' => 'default']);
$this->call('import:archive', ['--yes' => 'default']);
$this->call('import:sites', ['--yes' => 'default']);
$this->call('import:products-full', ['--yes' => 'default']);
$this->call('import:analytics');
Expand Down
37 changes: 0 additions & 37 deletions app/Console/Commands/Import/ImportArchive.php

This file was deleted.

1 change: 0 additions & 1 deletion app/Console/Commands/Import/ImportCollectionsFull.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ protected function importEndpoints()
$this->importEndpoint('artwork-place-qualifiers');
$this->importEndpoint('object-types');
$this->importEndpoint('agent-types');
$this->importEndpoint('catalogues');
$this->importEndpoint('categories');
$this->importEndpoint('terms');

Expand Down
41 changes: 0 additions & 41 deletions app/Console/Commands/Import/ImportLibrary.php

This file was deleted.

18 changes: 9 additions & 9 deletions app/Console/Commands/Import/ImportMobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ private function importArtworks($results)
$id = (int) $datum->nid;
$artwork = MobileArtwork::findOrNew($id);

$artwork->mobile_id = $id;
$artwork->id = $id;
$artwork->title = $datum->title;

$artwork->artwork_citi_id = $datum->id ?? $datum->object_id ?? null;
$artwork->artwork_id = $datum->id ?? $datum->object_id ?? null;

$location = explode(', ', $datum->location);
$artwork->latitude = (float) $location[0];
Expand All @@ -74,7 +74,7 @@ private function importSounds($results)
$id = (int) $datum->nid;
$sound = Sound::findOrNew($id);

$sound->mobile_id = $id;
$sound->id = $id;
$sound->title = $datum->title;

$sound->web_url = env('MOBILE_AUDIO_CDN_URL') . array_slice(explode('/', $datum->audio_file_url), -1)[0];
Expand All @@ -98,7 +98,7 @@ private function importTours($results)
$id = (int) $datum->nid;
$tour = Tour::findOrNew($id);

$tour->mobile_id = $id;
$tour->id = $id;
$tour->title = $datum->title;

$tour->image = $datum->image_url;
Expand All @@ -115,14 +115,14 @@ private function importTours($results)

private function importTourStops($data, $tour)
{
$this->info("Flushing tour stops for tour #{$tour->mobile_id}...");
$this->info("Flushing tour stops for tour #{$tour->id}...");

TourStop::where('tour_mobile_id', $tour->mobile_id)->delete();
TourStop::where('tour_id', $tour->id)->delete();

$this->info("Importing tour stops for tour #{$tour->mobile_id}...");
$this->info("Importing tour stops for tour #{$tour->id}...");

foreach ($data as $datum) {
$this->info("Importing tour stop [ {$tour->mobile_id} / {$datum->object} / {$datum->audio_id} ]");
$this->info("Importing tour stop [ {$tour->id} / {$datum->object} / {$datum->audio_id} ]");

$id = cantorTuple($datum->object, $datum->audio_id);

Expand All @@ -131,7 +131,7 @@ private function importTourStops($data, $tour)
$stop->id = $id;
$stop->weight = $datum->sort;

$stop->tour()->associate($tour->mobile_id);
$stop->tour()->associate($tour->id);
$stop->artwork()->associate($datum->object);
$stop->sound()->associate($datum->audio_id);

Expand Down
2 changes: 0 additions & 2 deletions app/Console/Commands/Import/ImportScheduleMonthly.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public function handle()
{
$this->call('import:analytics');

$this->call('import:library', ['--yes' => 'default']);
$this->call('import:archive', ['--yes' => 'default']);
$this->call('import:sites', ['--yes' => 'default']);
$this->call('import:dsc', ['--yes' => 'default']);
}
Expand Down
Loading

0 comments on commit 43096a5

Please sign in to comment.