Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Infrared signal selection #1

Merged
merged 36 commits into from
Jul 25, 2024
Merged

Update Infrared signal selection #1

merged 36 commits into from
Jul 25, 2024

Conversation

makeevrserg
Copy link
Collaborator

@makeevrserg makeevrserg commented Jul 23, 2024

Background:

This PR introduces new version of infrared signal selection with fixed several issues of previous version

Changes:

  • Database normalization fix
  • Configuration generator for categories
  • Configuration generator for devices
  • Fix brands sorting
  • Fix exception on non-existing brands
  • Fix duplicate signals
  • Improve parser speed
  • Fix device configuration sha hash generation

- remove orders
- db normalize fix
- detekt fix
- TableDao for normalization
- add config device generator
- add dbfile to ignore
- add comment to devicekey
- merge model package
- relocate infrared util
- relocate generators
- fix readme
- fix dockerfile
- fix database module name
- add button serializer test
- add empty key identifier
- fix class comparison of key identifier
- add categories config generator
- add initial logic to signal response
- disable safe checks
- make signal depends on brand
- fix sorting brands
- add second iteration of signal fetch
- add signal linking
- add postgres
- add exception for non expisting brands
- change signal model
- fix duplicate signals
- fix order signal by file popularity
- fix chunks
- fix selection when empty signals for current order
- fix window size
- fix multiple signal add
- add config repository to change it with sql later
- fix DeviceKeyNamesProvidery
- fix device config generator
- add todo
val includedInfraredFilesCount = transaction(database) { includedFileIds.count() }
when (includedInfraredFilesCount) {
0L -> {
TODO()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO?

val categoryType = CategoryType
.entries
.firstOrNull { it.folderName == category.folderName }
?: error("Could not find category with folderName ${category.folderName}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to do http error here?

index: Int
): CategoryConfiguration.OrderModel? {
return AllCategoryConfigGenerator
.generate(categoryType)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs to be cached

}
val response = SignalResponseModel(ifrFileModel = tableDao.ifrFileById(infraredFileId))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like faulty logic - if we have more than one file left the best solution would be to keep looking between them

}
val response = SignalResponseModel(ifrFileModel = tableDao.ifrFileById(infraredFileId))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like faulty logic - if we have more than one file left the best solution would be to keep looking between them

- Use batch inserts to make parser faster
- Fix signal selection
- Fix category configuration read
- fix category config path
- fix random error
- fix device configuration key generation
- fix sha256 generation
- fix signal hash
- fix response of http status code
- fix prints
- update irdb
@makeevrserg makeevrserg changed the title V2 Update Infrared signal selection Jul 25, 2024
@LionZXY LionZXY merged commit 732cfaa into dev Jul 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants