From 13179f08cd2c9440a971f2e6593632e28a6fcac8 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 26 Jul 2026 06:06:13 +0200 Subject: [PATCH] refactor: move the Plex switch-token parser in with the Plex models user_switch_response.dart was left holding a single 13-line function after UserSwitchResponse's decorative fields were dropped, so the filename no longer described its contents and it sat at lib/models/ root while every other Plex model lives in lib/models/plex/. Renamed to lib/models/plex/plex_switch_response.dart, with the test moved alongside the other plex_*_test.dart files. The parser stays public so the #1488 drift characterization tests keep exercising it directly. --- .../plex_switch_response.dart} | 0 lib/services/plex_auth_service.dart | 2 +- ...switch_response_test.dart => plex_switch_response_test.dart} | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename lib/models/{user_switch_response.dart => plex/plex_switch_response.dart} (100%) rename test/models/{user_switch_response_test.dart => plex_switch_response_test.dart} (97%) diff --git a/lib/models/user_switch_response.dart b/lib/models/plex/plex_switch_response.dart similarity index 100% rename from lib/models/user_switch_response.dart rename to lib/models/plex/plex_switch_response.dart diff --git a/lib/services/plex_auth_service.dart b/lib/services/plex_auth_service.dart index 04df153f..c6a415bf 100644 --- a/lib/services/plex_auth_service.dart +++ b/lib/services/plex_auth_service.dart @@ -8,7 +8,7 @@ import '../exceptions/media_server_exceptions.dart'; import '../models/plex/plex_user_profile.dart'; import '../models/plex/plex_home.dart'; import '../models/plex/plex_home_user.dart'; -import '../models/user_switch_response.dart'; +import '../models/plex/plex_switch_response.dart'; import '../utils/app_logger.dart'; import '../utils/device_identity.dart'; import '../utils/endpoint_race.dart'; diff --git a/test/models/user_switch_response_test.dart b/test/models/plex_switch_response_test.dart similarity index 97% rename from test/models/user_switch_response_test.dart rename to test/models/plex_switch_response_test.dart index 6d3b47f4..122c1de8 100644 --- a/test/models/user_switch_response_test.dart +++ b/test/models/plex_switch_response_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:plezy/models/user_switch_response.dart'; +import 'package:plezy/models/plex/plex_switch_response.dart'; /// A realistic `/api/v2/home/users/{uuid}/switch` 201 body using the /// July 2026 wire shape where profile language lists are CSV strings (#1488).