Merge remote-tracking branch 'origin/master' into feature/gpx-export

This commit is contained in:
Eugene Burmakin 2024-09-02 22:43:51 +02:00
commit 28190cebfd
8 changed files with 62 additions and 23 deletions

View file

@ -1 +1 @@
0.12.2
0.12.3

View file

@ -18,6 +18,30 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Default exporting format is now GeoJSON instead of Owntracks-like JSON. This will allow you to use the exported data in other applications that support GeoJSON format.
## [0.12.3] — 2024-09-02
### Added
- Resource limits to docke-compose.yml file to prevent server overload. Feel free to adjust the limits to your needs.
```yml
deploy:
resources:
limits:
cpus: '0.50' # Limit CPU usage to 50% of one core
memory: '2G' # Limit memory usage to 2GB
```
### Fixed
- Importing geodata from Immich will now not throw an error in the end of the process
### Changed
- A notification about an existing import with the same name will now show the import name
- Export file now also will contain `raw_dat` field for each point. This field contains the original data that was imported to the application.
## [0.12.2] — 2024-08-28
### Added

View file

@ -75,8 +75,8 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
attr_extras (7.1.0)
base64 (0.2.0)
@ -86,7 +86,7 @@ GEM
msgpack (~> 1.2)
builder (3.3.0)
byebug (11.1.3)
chartkick (5.0.7)
chartkick (5.1.0)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
@ -96,7 +96,7 @@ GEM
rexml
crass (1.0.6)
csv (3.3.0)
data_migrate (9.4.0)
data_migrate (9.4.2)
activerecord (>= 6.1)
railties (>= 6.1)
date (3.3.4)
@ -156,7 +156,7 @@ GEM
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
json-schema (4.3.0)
json-schema (4.3.1)
addressable (>= 2.8)
kaminari (1.2.2)
activesupport (>= 4.1.0)
@ -238,10 +238,10 @@ GEM
pry (>= 0.13.0)
psych (5.1.2)
stringio
public_suffix (5.0.5)
public_suffix (6.0.1)
puma (6.4.2)
nio4r (~> 2.0)
pundit (2.3.2)
pundit (2.4.0)
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.8.1)
@ -320,14 +320,14 @@ GEM
rswag-api (2.14.0)
activesupport (>= 5.2, < 8.0)
railties (>= 5.2, < 8.0)
rswag-specs (2.13.0)
activesupport (>= 3.1, < 7.2)
rswag-specs (2.14.0)
activesupport (>= 5.2, < 8.0)
json-schema (>= 2.2, < 5.0)
railties (>= 3.1, < 7.2)
railties (>= 5.2, < 8.0)
rspec-core (>= 2.14)
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rswag-ui (2.14.0)
actionpack (>= 5.2, < 8.0)
railties (>= 5.2, < 8.0)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
@ -395,7 +395,7 @@ GEM
railties (>= 7.0.0)
tailwindcss-rails (2.7.3-x86_64-linux)
railties (>= 7.0.0)
thor (1.3.1)
thor (1.3.2)
timeout (0.4.1)
turbo-rails (2.0.6)
actionpack (>= 6.0.0)
@ -414,7 +414,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.17)
zeitwerk (2.6.18)
PLATFORMS
aarch64-linux

View file

@ -39,7 +39,8 @@ class ExportSerializer
tst: point.timestamp.to_i,
inrids: point.inrids,
inregions: point.in_regions,
topic: point.topic
topic: point.topic,
raw_data: point.raw_data
}
end

View file

@ -18,7 +18,7 @@ class Immich::ImportGeodata
file_name = file_name(immich_data_json)
import = user.imports.find_or_initialize_by(name: file_name, source: :immich_api)
create_import_failed_notification and return unless import.new_record?
create_import_failed_notification(import.name) and return unless import.new_record?
import.raw_data = immich_data_json
import.save!
@ -84,12 +84,12 @@ class Immich::ImportGeodata
Rails.logger.debug 'No data found'
end
def create_import_failed_notification
def create_import_failed_notification(import_name)
Notifications::Create.new(
user:,
kind: :info,
title: 'Import was not created',
content: 'Import with the same name already exists. If you want to proceed, delete the existing import and try again.'
content: "Import with the same name (#{import_name}) already exists. If you want to proceed, delete the existing import and try again."
).call
end

View file

@ -11,6 +11,8 @@ class Immich::ImportParser
def call
json.each { |point| create_point(point) }
{ raw_points: 0, points: 0, doubles: 0, processed: 0 }
end
def create_point(point)

View file

@ -57,6 +57,11 @@ services:
depends_on:
- dawarich_db
- dawarich_redis
deploy:
resources:
limits:
cpus: '0.50' # Limit CPU usage to 50% of one core
memory: '2G' # Limit memory usage to 2GB
dawarich_sidekiq:
image: freikin/dawarich:latest
container_name: dawarich_sidekiq
@ -90,6 +95,11 @@ services:
- dawarich_db
- dawarich_redis
- dawarich_app
deploy:
resources:
limits:
cpus: '0.50' # Limit CPU usage to 50% of one core
memory: '2G' # Limit memory usage to 2GB
volumes:
db_data:

View file

@ -30,7 +30,8 @@ RSpec.describe ExportSerializer do
tst: points.first.timestamp.to_i,
inrids: points.first.inrids,
inregions: points.first.in_regions,
topic: points.first.topic
topic: points.first.topic,
raw_data: points.first.raw_data
},
{
lat: points.second.latitude,
@ -50,7 +51,8 @@ RSpec.describe ExportSerializer do
tst: points.second.timestamp.to_i,
inrids: points.second.inrids,
inregions: points.second.in_regions,
topic: points.second.topic
topic: points.second.topic,
raw_data: points.second.raw_data
}
]
}