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 version to 1.1.0 #16

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.1.0
- Fix use int for file priority

## 1.0.7
- Fix convert tracker tier empty string to nul

Expand Down
27 changes: 0 additions & 27 deletions lib/src/v2/torrents/dto/file_priority.dart

This file was deleted.

3 changes: 1 addition & 2 deletions lib/src/v2/torrents/dto/torrent_contents.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/file_priority.dart';

part 'torrent_contents.g.dart';

Expand Down Expand Up @@ -37,7 +36,7 @@ class TorrentContents {

/// File priority
@JsonKey(name: 'priority')
final FilePriority? priority;
final int? priority;

/// True if file is seeding/complete
@JsonKey(name: 'is_seed')
Expand Down
12 changes: 2 additions & 10 deletions lib/src/v2/torrents/dto/torrent_contents.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/src/v2/torrents/torrents.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export './dto/add_peers_result.dart';
export './dto/category.dart';
export './dto/file_priority.dart';
export './dto/new_torrents.dart';
export './dto/piece_state.dart';
export './dto/ratio_limit.dart';
Expand Down
5 changes: 2 additions & 3 deletions lib/src/v2/torrents/torrents_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'dart:typed_data';
import 'package:qbittorrent_api/src/network/api_client.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/add_peers_result.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/category.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/file_priority.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/new_torrents.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/piece_state.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/ratio_limit.dart';
Expand Down Expand Up @@ -358,14 +357,14 @@ class TorrentsController {
Future<void> setFilePriority({
required String hash,
required List<String> fileIds,
required FilePriority priority,
required int priority,
}) async {
await _apiClient.post(
'/torrents/filePrio',
body: {
'hash': hash,
'id': const ListItemConverter.bar().toJson(fileIds),
'priority': priority.value,
'priority': priority,
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: qbittorrent_api
description: This package provides methods for making requests to qBittorrent Web API using Dart.
version: 1.0.7
version: 1.1.0
repository: https://github.com/yosemiteyss/qbittorrent_api

environment:
Expand Down
7 changes: 3 additions & 4 deletions test/v2/torrents/torrents_controller_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:io';
import 'dart:math';
import 'dart:typed_data';

import 'package:qbittorrent_api/src/v2/torrents/dto/file_priority.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/new_torrents.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/piece_state.dart';
import 'package:qbittorrent_api/src/v2/torrents/dto/ratio_limit.dart';
Expand Down Expand Up @@ -335,7 +334,7 @@ void main() {
'test_folder/images/LOC_Main_Reading_Room_Highsmith.jpg',
);
expect(contents[0].pieceRange, [0, 537]);
expect(contents[0].priority, FilePriority.normal);
expect(contents[0].priority, 1);
expect(contents[0].progress, 1);
expect(contents[0].size, 17614527);
});
Expand Down Expand Up @@ -675,7 +674,7 @@ void main() {
await torrentsController.setFilePriority(
hash: 'd984f67af9917b214cd8b6048ab5624c7df6a07a',
fileIds: ['0', '1'],
priority: FilePriority.ignored,
priority: 1,
);
});

Expand All @@ -684,7 +683,7 @@ void main() {
await torrentsController.setFilePriority(
hash: 'd984f67af9917b214cd8b6048ab5624c7df6a07a',
fileIds: ['0', '1'],
priority: FilePriority.ignored,
priority: 1,
);
final body = fakeApiClient.getBody() as Map<String, dynamic>?;
expect(body?['id'], '0|1');
Expand Down