Skip to content

Commit b26fc52

Browse files
committed
history -3d, 200max
1 parent b1f4ddb commit b26fc52

7 files changed

Lines changed: 52 additions & 34 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,15 @@ only 1-9, basic latin and ligatures
198198
![](images/chapters.jpg)
199199

200200
### History
201+
- 200 max history items
201202
- shows audiobook title with chapter title and time position
202-
- duration of audiobook
203+
- duration of audiobook and days ago
203204
- percent progress of total timeline position
204205
- timeline position of where it'll resume
205206
- press h 1-9 to quickly open history entries
206207
- sorted by most recent
207208
- only shows most recent chapter with a particular audiobook
209+
- youtube streams also show
208210

209211
![](images/history.jpg)
210212

@@ -333,7 +335,7 @@ try Pause mode 2s, Hide Chapter Title, Shuffle
333335
![](images/translatevtt.jpg)
334336

335337
### Youtube
336-
- handles videos or audio to stream (ignored for History, Stats), disabled on android/iOS
338+
- handles videos or audio to stream (ignored for Stats), disabled on android/iOS
337339
- stream playlists too but must select each item, no skip to next playlist item
338340
- download video or audio and playlists with option to resume includes soundcloud and spreaker
339341
- displays subs automatically if avaiable based on default language which can be set

lib/screens/player_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,8 +2399,8 @@ class _PlayerScreenState extends State<PlayerScreen>
23992399
),
24002400
);
24012401

2402-
if (_history.length > 99) {
2403-
_history = _history.sublist(0, 99);
2402+
if (_history.length > 200) {
2403+
_history = _history.sublist(0, 200);
24042404
}
24052405
final prefs = await SharedPreferences.getInstance();
24062406
await prefs.setStringList(

lib/widgets/side_panel.dart

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -951,29 +951,33 @@ class SidePanel extends StatelessWidget {
951951
const TextStyle(fontSize: 10, color: Colors.white),
952952
),
953953
),
954-
title: RichText(
955-
text: TextSpan(
956-
style: const TextStyle(color: Colors.white, fontSize: 14),
957-
children: [
958-
TextSpan(text: item.audiobookTitle),
959-
if (snapshot.hasData) ...[
960-
TextSpan(
961-
text: ' \u200E${snapshot.data!['duration']}',
962-
style: const TextStyle(color: Colors.lightBlue),
954+
title: RichText(
955+
text: TextSpan(
956+
style: const TextStyle(color: Colors.white, fontSize: 14),
957+
children: [
958+
TextSpan(text: item.audiobookTitle),
959+
if (snapshot.hasData) ...[
960+
TextSpan(
961+
text: ' \u200E${snapshot.data!['duration']}',
962+
style: const TextStyle(color: Colors.lightBlue),
963+
),
964+
if (snapshot.data!['progress'] != null &&
965+
snapshot.data!['progress'].toString().isNotEmpty &&
966+
_parseProgress(
967+
snapshot.data!['progress'].toString()) >
968+
0.9)
969+
TextSpan(
970+
text: ' \u200E${snapshot.data!['progress']}',
971+
style: TextStyle(color: Colors.purple[200]),
972+
),
973+
],
974+
TextSpan(
975+
text: ' \u200E${_daysAgoLabel(item.lastPlayed)}',
976+
style: const TextStyle(color: Colors.white38),
977+
),
978+
],
963979
),
964-
if (snapshot.data!['progress'] != null &&
965-
snapshot.data!['progress'].toString().isNotEmpty &&
966-
_parseProgress(
967-
snapshot.data!['progress'].toString()) >
968-
0.9)
969-
TextSpan(
970-
text: ' \u200E${snapshot.data!['progress']}',
971-
style: TextStyle(color: Colors.purple[200]),
972-
),
973-
],
974-
],
975-
),
976-
),
980+
),
977981
subtitle: Text(
978982
'$ltr${item.chapterTitle} • ${_formatDuration(item.lastPosition)}',
979983
style: const TextStyle(color: Colors.white54, fontSize: 12),
@@ -990,6 +994,18 @@ class SidePanel extends StatelessWidget {
990994
);
991995
}
992996

997+
String _daysAgoLabel(DateTime lastPlayed) {
998+
final now = DateTime.now();
999+
final today = DateTime(now.year, now.month, now.day);
1000+
final playedDay =
1001+
DateTime(lastPlayed.year, lastPlayed.month, lastPlayed.day);
1002+
final days = today.difference(playedDay).inDays;
1003+
1004+
if (days <= 0) return 'today';
1005+
if (days == 1) return 'yesterday';
1006+
return '-${days}d';
1007+
}
1008+
9931009
Widget _buildPlaylistList(BuildContext context) {
9941010
final filteredPlaylist = getFilteredPlaylist();
9951011

lib/widgets/youtube_dialog.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,19 @@ Future<Map<String, dynamic>?> showYouTubeDialog(BuildContext context) async {
166166
'YouTube Audio',
167167
style: TextStyle(
168168
color: Colors.white,
169-
fontSize: 28,
169+
fontSize: 20,
170170
fontWeight: FontWeight.bold,
171171
),
172172
),
173173
],
174174
),
175-
const SizedBox(height: 24),
175+
const SizedBox(height: 8),
176176
const Text(
177177
'Paste a YouTube URL or playlist to stream audio only\nSubtitles will be downloaded automatically if available',
178-
style: TextStyle(color: Colors.white70, fontSize: 16),
178+
style: TextStyle(color: Colors.white70, fontSize: 12),
179179
textAlign: TextAlign.center,
180180
),
181-
const SizedBox(height: 32),
181+
const SizedBox(height: 10),
182182

183183
// URL input
184184
TextField(
@@ -244,7 +244,7 @@ Future<Map<String, dynamic>?> showYouTubeDialog(BuildContext context) async {
244244
),
245245
contentPadding: const EdgeInsets.symmetric(
246246
horizontal: 20,
247-
vertical: 16,
247+
vertical: 12,
248248
),
249249
),
250250
onChanged: (value) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: substitcher
22
description: opus chaptered audiobook player, encoder and editor with colored subtitle support, basic video editor
33
publish_to: "none"
4-
version: 26.07.24
4+
version: 26.07.25
55

66
environment:
77
sdk: ">=3.0.0 <4.0.0"

scripts/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pkgname=substitcher-bin
2-
pkgver=26.07.24
2+
pkgver=26.07.25
33
pkgrel=1
44
pkgdesc="Audiobook encoder and player with subtitle support"
55
arch=('x86_64')

scripts/build_appimage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
APP_NAME="substitcher"
6-
APP_VERSION="26.07.24"
6+
APP_VERSION="26.07.25"
77
BUILD_DIR="build/linux/x64/release/bundle"
88
APPDIR="AppDir"
99

0 commit comments

Comments
 (0)