Skip to content

Commit d70d8f9

Browse files
authored
internal: Develop to main (#49)
* feat: add playlists * fix: fix audio player * fix: repair url path in local file manager * feat: improve audio player * feat: playlist improvements * feat: refresh data files improvement * feat: improvements in playlist * feat: add tfm audio app * fix: repair workflow
2 parents f7c5a83 + 19a1850 commit d70d8f9

155 files changed

Lines changed: 23146 additions & 510 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/buildrelease.yml

Lines changed: 336 additions & 44 deletions
Large diffs are not rendered by default.

TFMAudioApp/.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Build results
2+
bin/
3+
obj/
4+
[Dd]ebug/
5+
[Rr]elease/
6+
x64/
7+
x86/
8+
[Aa][Rr][Mm]/
9+
[Aa][Rr][Mm]64/
10+
bld/
11+
[Bb]in/
12+
[Oo]bj/
13+
[Ll]og/
14+
[Ll]ogs/
15+
16+
# Visual Studio files
17+
.vs/
18+
*.suo
19+
*.user
20+
*.userosscache
21+
*.sln.docstates
22+
*.userprefs
23+
24+
# Rider files
25+
.idea/
26+
27+
# VS Code files
28+
.vscode/
29+
30+
# macOS
31+
.DS_Store
32+
.AppleDouble
33+
.LSOverride
34+
35+
# Windows
36+
Thumbs.db
37+
ehthumbs.db
38+
Desktop.ini
39+
40+
# MAUI / .NET specific
41+
*.csproj.user
42+
*.rsuser
43+
*.svclog
44+
*.scc
45+
*.aps
46+
47+
# NuGet
48+
*.nupkg
49+
*.snupkg
50+
**/[Pp]ackages/*
51+
!**/[Pp]ackages/build/
52+
*.nuget.props
53+
*.nuget.targets
54+
55+
# Android
56+
*.apk
57+
*.aab
58+
*.keystore
59+
!tfmaudio-release.keystore
60+
*.jks
61+
local.properties
62+
*.dex
63+
*.class
64+
gen/
65+
proguard/
66+
67+
# iOS / macOS
68+
*.ipa
69+
*.dSYM.zip
70+
*.dSYM
71+
*.xcuserstate
72+
*.xcworkspace
73+
!*.xcworkspace/contents.xcworkspacedata
74+
xcuserdata/
75+
*.pbxuser
76+
*.perspective
77+
*.perspectivev3
78+
*.mode1v3
79+
*.mode2v3
80+
Pods/
81+
Podfile.lock
82+
83+
# Windows MSIX
84+
*.msix
85+
*.msixbundle
86+
*.appx
87+
*.appxbundle
88+
*.appxupload
89+
90+
# Certificates and secrets
91+
*.pfx
92+
*.p12
93+
*.cer
94+
*.pem
95+
certificates/
96+
!certificates/.gitkeep
97+
98+
# Database files
99+
*.db
100+
*.db-shm
101+
*.db-wal
102+
*.sqlite
103+
*.sqlite3
104+
105+
# Crash reports
106+
crashlytics-build.properties
107+
fabric.properties
108+
109+
# Test results
110+
TestResults/
111+
*.trx
112+
*.coverage
113+
*.coveragexml
114+
115+
# Publish output
116+
publish/
117+
artifacts/
118+
119+
# Temporary files
120+
*.tmp
121+
*.temp
122+
*.bak
123+
*.swp
124+
*~
125+
126+
# Generated files
127+
Generated/
128+
*.g.cs
129+
*.g.i.cs
130+
131+
# MlaunchLog
132+
MlaunchLog/

TFMAudioApp/App.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:TFMAudioApp"
5+
x:Class="TFMAudioApp.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>

TFMAudioApp/App.xaml.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using TFMAudioApp.Helpers;
2+
using TFMAudioApp.Services.Interfaces;
3+
using TFMAudioApp.Views;
4+
5+
namespace TFMAudioApp;
6+
7+
public partial class App : Application
8+
{
9+
private readonly ISettingsService _settingsService;
10+
private readonly IAudioPlayerService _audioPlayerService;
11+
12+
public App(ISettingsService settingsService, IAudioPlayerService audioPlayerService)
13+
{
14+
InitializeComponent();
15+
_settingsService = settingsService;
16+
_audioPlayerService = audioPlayerService;
17+
}
18+
19+
protected override Window CreateWindow(IActivationState? activationState)
20+
{
21+
var window = new Window(new AppShell());
22+
23+
// Handle window closing (app terminated)
24+
window.Destroying += OnWindowDestroying;
25+
26+
return window;
27+
}
28+
29+
protected override async void OnStart()
30+
{
31+
base.OnStart();
32+
await NavigateToStartPageAsync();
33+
}
34+
35+
private void OnWindowDestroying(object? sender, EventArgs e)
36+
{
37+
// Stop playback when app window is destroyed
38+
System.Diagnostics.Debug.WriteLine("[App] Window destroying - stopping audio player");
39+
try
40+
{
41+
_audioPlayerService.StopAsync().ConfigureAwait(false);
42+
43+
// Dispose the player to clean up resources
44+
if (_audioPlayerService is IDisposable disposable)
45+
{
46+
disposable.Dispose();
47+
}
48+
}
49+
catch (Exception ex)
50+
{
51+
System.Diagnostics.Debug.WriteLine($"[App] Error stopping player on destroy: {ex.Message}");
52+
}
53+
}
54+
55+
private async Task NavigateToStartPageAsync()
56+
{
57+
var config = await _settingsService.GetServerConfigAsync();
58+
59+
if (config == null || !config.IsValid)
60+
{
61+
await Shell.Current.GoToAsync($"//{Constants.SetupRoute}");
62+
}
63+
else
64+
{
65+
await Shell.Current.GoToAsync($"//{Constants.HomeRoute}");
66+
}
67+
}
68+
}

TFMAudioApp/AppShell.xaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="TFMAudioApp.AppShell"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:views="clr-namespace:TFMAudioApp.Views"
7+
xmlns:controls="clr-namespace:TFMAudioApp.Controls"
8+
Title="TFM Audio"
9+
FlyoutBehavior="Flyout"
10+
Shell.BackgroundColor="{StaticResource PageBackgroundColor}"
11+
Shell.FlyoutBackgroundColor="{StaticResource CardBackgroundColor}"
12+
Shell.TitleColor="White"
13+
Shell.ForegroundColor="White">
14+
15+
<!-- Mini Player Footer -->
16+
<Shell.FlyoutFooter>
17+
<controls:MiniPlayerControl x:Name="MiniPlayer"/>
18+
</Shell.FlyoutFooter>
19+
20+
<Shell.FlyoutHeader>
21+
<VerticalStackLayout Padding="20" Spacing="10" BackgroundColor="{StaticResource PageBackgroundColor}">
22+
<Label Text="🎵" FontSize="48" HorizontalOptions="Center"/>
23+
<Label Text="TFM Audio"
24+
FontSize="24"
25+
FontAttributes="Bold"
26+
HorizontalOptions="Center"
27+
TextColor="{StaticResource Primary}"/>
28+
<!-- Connection Status Indicator -->
29+
<HorizontalStackLayout HorizontalOptions="Center" Spacing="5" Margin="0,5,0,0">
30+
<Label x:Name="ConnectionIndicator"
31+
Text=""
32+
FontSize="12"
33+
TextColor="{StaticResource Primary}"
34+
VerticalOptions="Center"/>
35+
<Label x:Name="ConnectionText"
36+
Text="Connected"
37+
FontSize="12"
38+
TextColor="{StaticResource Gray400}"
39+
VerticalOptions="Center"/>
40+
</HorizontalStackLayout>
41+
<BoxView HeightRequest="1" Color="{StaticResource Gray600}" Margin="0,10,0,0"/>
42+
</VerticalStackLayout>
43+
</Shell.FlyoutHeader>
44+
45+
<!-- Setup Page (not in flyout) -->
46+
<ShellContent
47+
Route="setup"
48+
ContentTemplate="{DataTemplate views:SetupPage}"
49+
FlyoutItemIsVisible="False"/>
50+
51+
<!-- Main Navigation -->
52+
<FlyoutItem Title="Home" Icon="{OnPlatform Default='home.png'}">
53+
<ShellContent
54+
Route="home"
55+
ContentTemplate="{DataTemplate views:HomePage}"/>
56+
</FlyoutItem>
57+
58+
<FlyoutItem Title="Channels" Icon="{OnPlatform Default='channels.png'}">
59+
<ShellContent
60+
Route="channels"
61+
ContentTemplate="{DataTemplate views:ChannelsPage}"/>
62+
</FlyoutItem>
63+
64+
<FlyoutItem Title="Playlists" Icon="{OnPlatform Default='playlists.png'}">
65+
<ShellContent
66+
Route="playlists"
67+
ContentTemplate="{DataTemplate views:PlaylistsPage}"/>
68+
</FlyoutItem>
69+
70+
<FlyoutItem Title="Downloads" Icon="{OnPlatform Default='downloads.png'}">
71+
<ShellContent
72+
Route="downloads"
73+
ContentTemplate="{DataTemplate views:DownloadsPage}"/>
74+
</FlyoutItem>
75+
76+
<FlyoutItem Title="Settings" Icon="{OnPlatform Default='settings.png'}">
77+
<ShellContent
78+
Route="settings"
79+
ContentTemplate="{DataTemplate views:SettingsPage}"/>
80+
</FlyoutItem>
81+
82+
</Shell>

TFMAudioApp/AppShell.xaml.cs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using TFMAudioApp.Services.Interfaces;
2+
using TFMAudioApp.Views;
3+
4+
namespace TFMAudioApp;
5+
6+
public partial class AppShell : Shell
7+
{
8+
private IConnectivityService? _connectivityService;
9+
10+
public AppShell()
11+
{
12+
InitializeComponent();
13+
14+
// Register routes for pages that are navigated to with parameters
15+
Routing.RegisterRoute("playlistdetail", typeof(PlaylistDetailPage));
16+
Routing.RegisterRoute("channeldetail", typeof(ChannelDetailPage));
17+
Routing.RegisterRoute("folderdetail", typeof(FolderDetailPage));
18+
Routing.RegisterRoute("player", typeof(PlayerPage));
19+
}
20+
21+
protected override void OnHandlerChanged()
22+
{
23+
base.OnHandlerChanged();
24+
25+
if (Handler != null)
26+
{
27+
InitializeConnectivityService();
28+
}
29+
}
30+
31+
private void InitializeConnectivityService()
32+
{
33+
_connectivityService = Application.Current?.Handler?.MauiContext?.Services.GetService<IConnectivityService>();
34+
35+
if (_connectivityService != null)
36+
{
37+
_connectivityService.ConnectivityChanged += OnConnectivityChanged;
38+
UpdateConnectionUI(_connectivityService.IsConnected);
39+
}
40+
}
41+
42+
private void OnConnectivityChanged(object? sender, bool isConnected)
43+
{
44+
MainThread.BeginInvokeOnMainThread(() =>
45+
{
46+
UpdateConnectionUI(isConnected);
47+
});
48+
}
49+
50+
private void UpdateConnectionUI(bool isConnected)
51+
{
52+
if (ConnectionIndicator != null && ConnectionText != null)
53+
{
54+
if (isConnected)
55+
{
56+
ConnectionIndicator.TextColor = Color.FromArgb("#22C55E"); // Green
57+
ConnectionText.Text = "Online";
58+
}
59+
else
60+
{
61+
ConnectionIndicator.TextColor = Color.FromArgb("#EF4444"); // Red
62+
ConnectionText.Text = "Offline";
63+
}
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)