mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
deactivate bookcases
This commit is contained in:
@@ -28,12 +28,16 @@ class SyncOpenBooks extends Command
|
|||||||
{
|
{
|
||||||
$response = Http::post('https://openbookcase.de/api/listarea/83.08995477111446/-200.56640625000003/-38.13455657705413/221.30859375000003');
|
$response = Http::post('https://openbookcase.de/api/listarea/83.08995477111446/-200.56640625000003/-38.13455657705413/221.30859375000003');
|
||||||
|
|
||||||
|
$ids = collect($response->json()['cases'])->pluck('id');
|
||||||
|
|
||||||
foreach ($response->json()['cases'] as $case) {
|
foreach ($response->json()['cases'] as $case) {
|
||||||
|
try {
|
||||||
BookCase::updateOrCreate(
|
BookCase::updateOrCreate(
|
||||||
[
|
[
|
||||||
'id' => $case['id'],
|
'id' => $case['id'],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
'id' => $case['id'],
|
||||||
'title' => $case['title'],
|
'title' => $case['title'],
|
||||||
'latitude' => (float) $case['lat'],
|
'latitude' => (float) $case['lat'],
|
||||||
'longitude' => (float) $case['lon'],
|
'longitude' => (float) $case['lon'],
|
||||||
@@ -52,8 +56,15 @@ class SyncOpenBooks extends Command
|
|||||||
'created_by' => 1,
|
'created_by' => 1,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return Command::SUCCESS;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BookCase::query()
|
||||||
|
->whereNotIn('id', $ids)
|
||||||
|
->update(['deactivated' => true]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -766,5 +766,6 @@
|
|||||||
"Article already tweeted": "Artikel bereits getwittert",
|
"Article already tweeted": "Artikel bereits getwittert",
|
||||||
"Is this a news article?": "Dieser Artikel ist ein News-Artikel",
|
"Is this a news article?": "Dieser Artikel ist ein News-Artikel",
|
||||||
"Are your sure?": "Bist du dir sicher?",
|
"Are your sure?": "Bist du dir sicher?",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -763,5 +763,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -763,5 +763,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -764,5 +764,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -726,5 +726,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
@@ -738,5 +738,6 @@
|
|||||||
"Article already tweeted": "",
|
"Article already tweeted": "",
|
||||||
"Is this a news article?": "",
|
"Is this a news article?": "",
|
||||||
"Are your sure?": "",
|
"Are your sure?": "",
|
||||||
"Nostr public key": ""
|
"Nostr public key": "",
|
||||||
|
"Amount": ""
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user