30 Commits
Author SHA1 Message Date
pi-ux-ce 1041b21e96 Upload files to "/"
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 2m0s
2025-06-11 10:38:57 +00:00
pi-ux-ce 96797141fa uploading this for auto download purpose
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m51s
2025-06-11 08:28:29 +00:00
pi-ux-ce 4ced92e3cc Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m34s
2025-06-10 14:18:53 +00:00
pi-ux-ce 9b8c236ecf Update Program.cs
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Has been cancelled
2025-06-10 14:18:04 +00:00
pi-ux-ce c7bb0fe543 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m33s
2025-06-10 12:54:03 +00:00
pi-ux-ce 2de68761af it is working , moving to version 2.0.0 as it is a big change
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m38s
2025-06-10 12:48:07 +00:00
pi-ux-ce 16806a90b9 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m20s
2025-06-10 12:41:45 +00:00
pi-ux-ce 800faf26ce Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m18s
2025-06-10 12:25:03 +00:00
pi-ux-ce a4623d1e60 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m20s
2025-06-10 12:21:46 +00:00
pi-ux-ce 6b2b6b3996 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m22s
2025-06-10 12:17:24 +00:00
pi-ux-ce 0998bf4b3f Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Has been cancelled
2025-06-10 12:16:12 +00:00
pi-ux-ce 8a39d4a4b2 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Has been cancelled
2025-06-10 12:13:58 +00:00
pi-ux-ce 4edcac18eb Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Has been cancelled
2025-06-10 12:12:46 +00:00
pi-ux-ce 36dc76f500 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m25s
2025-06-10 12:00:44 +00:00
pi-ux-ce 05154527db Update .gitea/workflows/dotnetbuild_runner.yaml 2025-06-10 12:00:19 +00:00
pi-ux-ce 9732737d7d Update .gitea/workflows/dotnetbuild_runner.yaml 2025-06-10 11:59:59 +00:00
pi-ux-ce 37d1057970 Update .gitea/workflows/dotnetbuild_runner.yaml 2025-06-10 11:59:11 +00:00
pi-ux-ce 99407b6117 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m28s
2025-06-10 11:53:15 +00:00
pi-ux-ce f01169b8fc Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m25s
2025-06-10 11:45:29 +00:00
pi-ux-ce 536f0a6029 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m25s
2025-06-10 11:39:32 +00:00
pi-ux-ce a5b19d112c Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Has been cancelled
2025-06-10 11:38:42 +00:00
pi-ux-ce 2366863776 try playing with the version
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m6s
2025-06-10 11:31:56 +00:00
pi-ux-ce 7237086810 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m27s
2025-06-10 10:00:01 +00:00
pi-ux-ce fed8499119 Update .gitea/workflows/dotnetbuild_runner.yaml
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m16s
2025-06-10 09:57:16 +00:00
pi-ux-ce 48675b1291 try to zip whole folder
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m37s
2025-06-10 09:46:59 +00:00
pi-ux-ce 451face0f3 Update Simpsons_generator.csproj
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m26s
2025-06-10 07:41:25 +00:00
pi-ux-ce b8ba273e0e download the database if not present
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m27s
2025-06-09 22:54:11 +00:00
pi-ux-ce 80951ff41c 🎨 refactoring
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m33s
2025-06-09 22:42:08 +00:00
pi-ux-ce 45f318d8f2 add package
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m16s
2025-06-09 22:26:37 +00:00
pi-ux-ce 1837e19968 Merge pull request 'pi-ux-ce-patch-1' (#1) from pi-ux-ce-patch-1 into main
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m3s
Reviewed-on: #1
2025-06-09 22:19:32 +00:00
5 changed files with 120 additions and 52 deletions
+51 -2
View File
@@ -10,7 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compute next version
id: versioning
run: |
latest="${{ vars.VERSION }}"
next_version=$(echo "$latest" | awk -F. -v OFS=. '{$NF += 1 ; print}')
echo "Next version: $next_version"
echo "next_version=$next_version" >> $GITHUB_ENV
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
@@ -20,9 +30,15 @@ jobs:
- name: Test with dotnet
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Build the package
run: dotnet build
run: dotnet build -p:Version=$next_version
- name: Publish the package
run: dotnet publish -p:PublishSingleFile=true --self-contained false --runtime win-x64
- name: copy the release before compression
run: cp -r /workspace/pi-ux-ce/Simpsons_generator/bin/Release/net8.0/win-x64/publish/ .
- uses: montudor/action-zip@v1
with:
args: zip -qq -r Simpsons_generator.zip publish/
#working-directory: path/to/work-dir
- name: List all files
run: |
find /workspace/pi-ux-ce/Simpsons_generator/bin
@@ -32,9 +48,42 @@ jobs:
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} -X DELETE \
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.exe
- name: upload latest version
- name: Delete existing latest version
run: |
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} -X DELETE \
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.zip
- name: upload latest zip version with version number
run: |
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
--upload-file Simpsons_generator.zip \
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/$next_version/Simpsons_generator.zip
- name: upload latest executable version with version number
run: |
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
--upload-file /workspace/pi-ux-ce/Simpsons_generator/bin/Release/net8.0/win-x64/publish/Simpsons_generator.exe \
"https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/$next_version/Simpsons_generator.exe"
- name: upload latest zip version
run: |
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
--upload-file Simpsons_generator.zip \
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.zip
- name: upload latest executable version
run: |
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
--upload-file /workspace/pi-ux-ce/Simpsons_generator/bin/Release/net8.0/win-x64/publish/Simpsons_generator.exe \
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.exe
- name: update version in the variable
run: |
curl -X PUT -H "Content-Type: application/json" \
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/Simpsons_generator/actions/variables/VERSION \
-d "{\"Value\":\"$next_version\"}"
+66 -49
View File
@@ -2,6 +2,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Data.SQLite;
using System.Net;
using System.Runtime.InteropServices;
using static System.Net.Mime.MediaTypeNames;
@@ -9,20 +10,29 @@ namespace Simpsons_generator;
class Program
{
/* public static void openit(string x) {
System.Diagnostics.Process.Start("cmd", "/C start" + " " + x);
}*/
public static readonly string folder_path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Simpsons_generator");
public static readonly string filePath = Path.Combine(folder_path, "episodes-watched.csv");
public static readonly string overrideBrowser = Path.Combine(folder_path, "overrideBrowser.xml");
private static readonly string FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Simpsons_generator");
private static readonly string OverrideBrowser = Path.Combine(FolderPath, "overrideBrowser.xml");
public static readonly string filePath = Path.Combine(FolderPath, "episodes-watched.csv");
static SQLiteConnection CreateConnection()
{
SQLiteConnection sqliteconn;
if (!(File.Exists($"{FolderPath}/database.db")))
{
Console.WriteLine("Creating database.db");
using (var client = new WebClient())
{
client.DownloadFile("https://gitea.tryton.geeraert.eu//pi-ux-ce/Simpsons_generator/raw/branch/main/database.db", $"{FolderPath}/database.db");
}
}
// Create a new database connection:
var sqllitedatasource = $"Data Source={folder_path}/database.db;Version=3;New=True;Compress=True;";
var sqllitedatasource = $"Data Source={FolderPath}/database.db;Version=3;New=True;Compress=True;";
sqliteconn = new SQLiteConnection(sqllitedatasource);
// Open the connection:
try
@@ -47,12 +57,13 @@ class Program
// hack because of this: https://github.com/dotnet/corefx/issues/10361
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Console.WriteLine("Using Windows");
url = url.Replace("&", "^&");
if (File.Exists(overrideBrowser))
if (File.Exists(OverrideBrowser))
{
string browser_path = File.ReadAllText(overrideBrowser);
Console.WriteLine("browser: "+browser_path);
Process.Start(new ProcessStartInfo(browser_path, url) { CreateNoWindow = true });
string browserPath = File.ReadAllText(OverrideBrowser);
Console.WriteLine("browser: "+browserPath);
Process.Start(new ProcessStartInfo(browserPath, url) { CreateNoWindow = true });
}
else {
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
@@ -60,11 +71,22 @@ class Program
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Console.WriteLine("Using Linux");
try
{
Process.Start("xdg-open", url);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Console.WriteLine("Using Mac");
Process.Start("open", url);
}
else
@@ -79,42 +101,16 @@ class Program
}
private static bool CheckEpisodeAlreadyRun(string url)
static object RunSqlQuery(SQLiteConnection conn, string query)
{
if (File.Exists(filePath))
SQLiteDataReader sqliteDatareader;
SQLiteCommand sqliteCmd;
sqliteCmd = conn.CreateCommand();
sqliteCmd.CommandText = query;
sqliteDatareader = sqliteCmd.ExecuteReader();
if (sqliteDatareader.Read())
{
var linesRead = File.ReadLines(filePath);
// iterate through each element within the array and
// print it out
//
foreach (var lineRead in linesRead)
{
if (lineRead == url)
{
Console.WriteLine("already watched");
return true;
}
}
}
return false;
}
static object RunSQLQuery(SQLiteConnection conn, string query)
{
SQLiteDataReader sqlite_datareader;
SQLiteCommand sqlite_cmd;
sqlite_cmd = conn.CreateCommand();
sqlite_cmd.CommandText = query;
sqlite_datareader = sqlite_cmd.ExecuteReader();
if (sqlite_datareader.Read())
{
return sqlite_datareader["result"];
return sqliteDatareader["result"];
}
else
{
@@ -143,6 +139,27 @@ class Program
SQLiteConnection sqliteconn;
sqliteconn = CreateConnection();
//check if the old excel exist and convert it to SQLLITE
if (File.Exists(filePath))
{
Console.WriteLine("Excel file present");
var linesRead = File.ReadLines(filePath);
foreach (var lineRead in linesRead)
{
Console.WriteLine(lineRead);
string[] words = lineRead.Split('-');
int season = Convert.ToInt16(words[3]);
int episode = Convert.ToInt16(words[5]);
SaveIntoDatabase(sqliteconn,season,episode);
Console.WriteLine(season);
Console.WriteLine(episode);
}
System.IO.File.Move(filePath,filePath+"_converted.csv");
}
bool restart = false;
do
{
@@ -150,7 +167,7 @@ class Program
//get maximum number of seasons
string maximumNumberOfSeasonsQuery = "SELECT COUNT(DISTINCT season) as result FROM episodes;";
int maximumNumberSeasons = Convert.ToInt32(RunSQLQuery(sqliteconn, maximumNumberOfSeasonsQuery));
int maximumNumberSeasons = Convert.ToInt32(RunSqlQuery(sqliteconn, maximumNumberOfSeasonsQuery));
//random for the season
@@ -161,19 +178,19 @@ class Program
//get maximum number of episodes for this season
string maximumNumberOfEpisodesQuery = $"SELECT COUNT() as result FROM episodes WHERE season = {randomSeason};";
int maximumNumberOfEpisodes = Convert.ToInt32(RunSQLQuery(sqliteconn, maximumNumberOfEpisodesQuery));
int maximumNumberOfEpisodes = Convert.ToInt32(RunSqlQuery(sqliteconn, maximumNumberOfEpisodesQuery));
randomEpisode = rnd.Next(1, maximumNumberOfEpisodes);
Console.WriteLine("random episode: "+randomEpisode);
//url generated
string urlGeneratedQuery = $"SELECT url as result FROM episodes WHERE season = {randomSeason} and episode = {randomEpisode};";
urlGenerated = Convert.ToString(RunSQLQuery(sqliteconn, urlGeneratedQuery));
urlGenerated = Convert.ToString(RunSqlQuery(sqliteconn, urlGeneratedQuery));
//CheckEpisodeAlreadyRun
string checkEpisodeAlreadyRunQuery = $"SELECT seen as result FROM episodes WHERE season = {randomSeason} and episode = {randomEpisode};";
bool checkEpisodeAlreadyRun = Convert.ToBoolean(RunSQLQuery(sqliteconn, checkEpisodeAlreadyRunQuery));
bool checkEpisodeAlreadyRun = Convert.ToBoolean(RunSqlQuery(sqliteconn, checkEpisodeAlreadyRunQuery));
if (checkEpisodeAlreadyRun)
{
Binary file not shown.
+2
View File
@@ -8,10 +8,12 @@
<Nullable>enable</Nullable>
<ApplicationIcon>Simpson.ico</ApplicationIcon>
<PublishSingleFile>true</PublishSingleFile>
<PackAsTool>true</PackAsTool>
</PropertyGroup>
<ItemGroup>
<Content Include="Simpson.ico" />
<PackageReference Include="System.Data.SQLite" Version="1.0.119" />
</ItemGroup>
</Project>
Binary file not shown.