Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 41a06075bfe3d1efe0dce3bfb24a4a77b557be64
  • Loading branch information
Madari Developers committed Jan 7, 2025
1 parent 49d8ac5 commit 7a4759a
Show file tree
Hide file tree
Showing 31 changed files with 4,355 additions and 355 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ flutter run
Contributions, issues, and feature requests are welcome!
Feel free to fork the repository and submit a pull request.

# Legal Disclaimer
## Legal Disclaimer

This application is designed to be an open source media player that can process URLs and add-ons.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ class _ConfigureNeoConnectionState extends State<ConfigureNeoConnection> {
TextFormField(
controller: _usernameController,
decoration: const InputDecoration(
labelText: 'Username',
labelText: 'Email',
border: OutlineInputBorder(),
),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter username';
return 'Please enter email';
}
return null;
},
Expand Down
32 changes: 24 additions & 8 deletions lib/features/connections/service/base_connection_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import '../types/base/base.dart';
import '../widget/stremio/stremio_create.dart';

abstract class BaseConnectionService {
Widget renderCard(LibraryRecord library, LibraryItem item, String heroPrefix);
Widget renderList(LibraryRecord library, LibraryItem item, String heroPrefix);
Widget renderCard(LibraryItem item, String heroPrefix);
Widget renderList(LibraryItem item, String heroPrefix);

static final Map<String, RecordModel> _item = {};

final String connectionId;

Expand Down Expand Up @@ -46,14 +48,21 @@ abstract class BaseConnectionService {
static Future<ConnectionResponse> connectionByIdRaw(
String connectionId,
) async {
final result = await AppEngine.engine.pb
.collection("connection")
.getOne(connectionId, expand: "type");
RecordModel model_;

if (_item.containsKey(connectionId)) {
model_ = _item[connectionId]!;
} else {
model_ = await AppEngine.engine.pb
.collection("connection")
.getOne(connectionId, expand: "type");
_item[connectionId] = model_;
}

return ConnectionResponse(
connection: Connection.fromRecord(result),
connection: Connection.fromRecord(model_),
connectionTypeRecord: ConnectionTypeRecord.fromRecord(
result.get<RecordModel>("expand.type"),
model_.get<RecordModel>("expand.type"),
),
);
}
Expand Down Expand Up @@ -84,14 +93,17 @@ abstract class BaseConnectionService {
String? cursor,
});

Future<List<LibraryItem>> getBulkItem(
List<LibraryItem> ids,
);

Future<List<ConnectionFilter<T>>> getFilters<T>(
LibraryRecord library,
);

Future<LibraryItem?> getItemById(LibraryItem id);

Future<void> getStreams(
LibraryRecord library,
LibraryItem id, {
String? season,
String? episode,
Expand Down Expand Up @@ -191,6 +203,10 @@ class ConnectionFilterItem {
abstract class LibraryItem extends Jsonable {
late final String id;

LibraryItem({
required this.id,
});

@override
Map<String, dynamic> toJson();
}
Expand Down
Loading

0 comments on commit 7a4759a

Please sign in to comment.