Bump version to 0.99.46

- Fix model type reporting for user providers in analytics table
- Fix undefined placeholder variable in duplicate cache settings migration
parent bbc0696c
...@@ -805,9 +805,10 @@ class Analytics: ...@@ -805,9 +805,10 @@ class Analytics:
# Check user providers first if user_filter is set (not global only) # Check user providers first if user_filter is set (not global only)
if user_filter is not None and user_filter != -1: if user_filter is not None and user_filter != -1:
provider_config = self.db.get_user_provider(user_filter, provider_id) user_provider_data = self.db.get_user_provider(user_filter, provider_id)
if provider_config: if user_provider_data:
provider_type = provider_config['type'] provider_config = user_provider_data['config']
provider_type = provider_config.get('type', 'unknown')
# Fall back to global config if not found as user provider # Fall back to global config if not found as user provider
if not provider_config: if not provider_config:
......
...@@ -4070,19 +4070,20 @@ def DatabaseManager__run_config_migrations(self, cursor, auto_increment, timesta ...@@ -4070,19 +4070,20 @@ def DatabaseManager__run_config_migrations(self, cursor, auto_increment, timesta
user_id = user_row[0] user_id = user_row[0]
# Get all global settings for this user, ordered by updated_at DESC # Get all global settings for this user, ordered by updated_at DESC
placeholder = '?' if self.db_type == 'sqlite' else '%s'
cursor.execute(f''' cursor.execute(f'''
SELECT id FROM user_cache_settings SELECT id FROM user_cache_settings
WHERE user_id = {placeholder} AND provider_id IS NULL AND model_name IS NULL WHERE user_id = {placeholder} AND provider_id IS NULL AND model_name IS NULL
ORDER BY updated_at DESC ORDER BY updated_at DESC
''', (user_id,)) ''', (user_id,))
all_ids = [row[0] for row in cursor.fetchall()] all_ids = [row[0] for row in cursor.fetchall()]
if len(all_ids) > 1: if len(all_ids) > 1:
# Keep the first (most recent), delete the rest # Keep the first (most recent), delete the rest
keep_id = all_ids[0] keep_id = all_ids[0]
delete_ids = all_ids[1:] delete_ids = all_ids[1:]
placeholders = ','.join([placeholder] * len(delete_ids)) placeholders = ','.join([placeholder] * len(delete_ids))
cursor.execute(f''' cursor.execute(f'''
DELETE FROM user_cache_settings DELETE FROM user_cache_settings
......
...@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" ...@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "aisbf" name = "aisbf"
version = "0.99.45" version = "0.99.46"
description = "AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations" description = "AISBF - AI Service Broker Framework || AI Should Be Free - A modular proxy server for managing multiple AI provider integrations"
readme = "README.md" readme = "README.md"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment