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

Support HOS16.0.0 #76

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
690e010
support hos16.0.0 and min changes
zdm65477730 Mar 12, 2023
e1e4254
update NX.cpp
zdm65477730 Mar 13, 2023
c0ac7d9
Optimize the memory usage
zdm65477730 Mar 14, 2023
e83259b
use the correct time unit
zdm65477730 Mar 14, 2023
444d95a
solve the possiable ghost record issue
zdm65477730 Mar 15, 2023
67d1f87
fix ghost record in hidden view and fix crash when deleting importing…
zdm65477730 Mar 15, 2023
b21cd51
bump version to 1.5.0
zdm65477730 Mar 15, 2023
3971359
make sure the title vector has no zero id
zdm65477730 Mar 15, 2023
16cba33
uplift submodues
zdm65477730 Sep 12, 2023
e1adda1
update for new libnx
zdm65477730 Dec 27, 2023
5aa79bd
updatge submoudle
zdm65477730 Oct 18, 2024
c7523e7
update lib
zdm65477730 Oct 18, 2024
8ab2b18
update Makefile and system json
zdm65477730 Oct 18, 2024
c2be0e2
update Makefile for new libnx
zdm65477730 Oct 18, 2024
f34b7fe
update the update checking source
zdm65477730 Oct 21, 2024
8037b75
Create main.yml
zdm65477730 Nov 3, 2024
ac9287a
Update main.yml
zdm65477730 Nov 9, 2024
45d2c0b
Update main.yml
zdm65477730 Nov 9, 2024
77970ff
Update Makefile
zdm65477730 Nov 9, 2024
d38bf2d
Update main.yml
zdm65477730 Nov 9, 2024
4af4026
pull jpn&kr lang commits
zdm65477730 Nov 9, 2024
034c95f
Update main.yml
zdm65477730 Nov 10, 2024
21541d0
Update main.yml
zdm65477730 Nov 10, 2024
e6bb766
Update main.yml
zdm65477730 Nov 10, 2024
50d5d37
add Japanese support
zdm65477730 Nov 10, 2024
289d706
uplift Aether
zdm65477730 Nov 10, 2024
e0a84da
Update main.yml
zdm65477730 Nov 10, 2024
1129748
uplift Aether
zdm65477730 Nov 10, 2024
d6cf467
Optimize the loading performance when dealing with a large number of …
zdm65477730 Nov 15, 2024
78ff8d9
fix total play time in recent activity view mismatch
zdm65477730 Nov 17, 2024
320c2b8
fix total play time in recent activity view mismatch
zdm65477730 Nov 20, 2024
765de62
Make the recorded time more accurate
zdm65477730 Nov 22, 2024
23f43ba
update for use the same API for fetch user's game play data
zdm65477730 Nov 23, 2024
15fbf2b
fix data missing in year view
zdm65477730 Nov 23, 2024
8c09266
some fixes
zdm65477730 Nov 23, 2024
cc84306
fixed big when creating messageboxes and updated for full translations
zdm65477730 Nov 24, 2024
3888470
bump to v1.5.4
zdm65477730 Nov 24, 2024
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
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
issue_comment:
types: [ created ]

jobs:
build_and_release:
name: Build and release
runs-on: ubuntu-latest
container: devkitpro/devkita64:latest
if: contains(github.event.comment.body, '/release-action')

steps:
- name: Update packages
run: |
sudo -n apt-get update
sudo -n apt-get upgrade -y git build-essential
shell: bash
- name: Update latest libnx
run: |
git config --global --add safe.directory "*"
git clone --recurse-submodules https://github.com/zdm65477730/libnx.git
cd libnx
make install -j$(nproc)
shell: bash
- name: Checkout latest code
uses: actions/[email protected]
with:
ref: master
clean: true
fetch-depth: 0
fetch-tags: true
submodules: recursive
- name: Setup ENV parameters
run: |
VER_FILE=Application/Makefile
VERSION=$(awk '/^VER_MAJOR/{print $3}' $VER_FILE).$(awk '/^VER_MINOR/{print $3}' $VER_FILE).$(awk '/^VER_MICRO/{print $3}' $VER_FILE)
echo "TAG=v${VERSION}" > "${GITHUB_ENV}"
echo "RELEASE_NAME=NX-Activity-Log v${VERSION}" >> "${GITHUB_ENV}"
shell: bash
- name: Build
run: |
export DEVKITPRO=/opt/devkitpro
make -j$(nproc)
shell: bash
- name: Upload Release Asset
uses: softprops/[email protected]
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG }}
draft: false
prerelease: false
generate_release_notes: yes
make_latest: true
files: |
./sdcard/switch/NX-Activity-Log/NX-Activity-Log.nro
12 changes: 6 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "Translations"]
path = Application/romfs/lang
url = https://github.com/tallbl0nde/NX-Activity-Log-Translations.git
[submodule "libs/json"]
path = Application/libs/json
url = https://github.com/nlohmann/json.git
url = https://github.com/zdm65477730/NX-Activity-Log-Translations.git
[submodule "Application/libs/SimpleIniParser"]
path = Application/libs/SimpleIniParser
url = https://git.nicholemattera.com/NicholeMattera/Simple-INI-Parser
url = https://github.com/zdm65477730/SimpleIniParser.git
[submodule "Application/libs/json"]
path = Application/libs/json
url = https://github.com/nlohmann/json.git
[submodule "Application/libs/Aether"]
path = Application/libs/Aether
url = https://github.com/tallbl0nde/Aether
url = https://github.com/zdm65477730/Aether
10 changes: 5 additions & 5 deletions Application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ BUILD := build
INCLUDES := include
SOURCES := source
ROMFS := romfs
LIBS := -lAether -lcurl -lnx `sdl2-config --libs` -lSDL2_ttf `freetype-config --libs` -lSDL2_gfx -lSDL2_image -lpng -ljpeg -lwebp -lSimpleIniParser
LIBS := -lAether -lcurl -lnx `sdl2-config --libs` -lSDL2_ttf `freetype-config --libs` -lSDL2_gfx -lSDL2_image -lpng -ljpeg -lwebp -lSimpleIniParser -lharfbuzz
LIBDIRS := $(PORTLIBS) $(LIBNX) $(CURDIR)/libs/Aether $(CURDIR)/libs/json $(CURDIR)/libs/SimpleIniParser
FORWARDER := $(ROMFS)/exefs.nsp

#---------------------------------------------------------------------------------
# Application version
#---------------------------------------------------------------------------------
VER_MAJOR := 1
VER_MINOR := 4
VER_MICRO := 0
VER_MINOR := 5
VER_MICRO := 4

#---------------------------------------------------------------------------------
# Options for .nacp information
#---------------------------------------------------------------------------------
APP_TITLE := NX Activity Log
APP_AUTHOR := tallbl0nde
APP_AUTHOR := tallbl0nde&zdm65477730
APP_VERSION := $(VER_MAJOR).$(VER_MINOR).$(VER_MICRO)
ICON := icon.jpg

Expand All @@ -72,7 +72,7 @@ OUTPUT := $(CURDIR)/$(TARGET)
#---------------------------------------------------------------------------------
DEFINES := -D__SWITCH__ -DVER_MAJOR=$(VER_MAJOR) -DVER_MINOR=$(VER_MINOR) -DVER_MICRO=$(VER_MICRO) -DVER_STRING=\"$(VER_MAJOR).$(VER_MINOR).$(VER_MICRO)\"
CFLAGS := -g -Wall -O2 -ffunction-sections $(ARCH) $(DEFINES) $(INCLUDE) `freetype-config --cflags` `sdl2-config --cflags`
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++2a
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=c++23

#----------------------------------------------------------------------------------------------------------------------
# Definition of variables which store file locations
Expand Down
1 change: 1 addition & 0 deletions Application/include/Types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum Language {
ChineseTraditional,
Chinese,
Korean,
Japanese,
TotalLanguages // Total number of languages (only used for iterating)
};
// Return string matching language
Expand Down
26 changes: 13 additions & 13 deletions Application/include/nx/PlayData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,37 @@ namespace NX {

// PlayEvents are parsed PdmPlayEvents containing only necessary information
struct PlayEvent {
PlayEventType type; // Type of PlayEvent
AccountUid userID; // UserID
TitleID titleID; // TitleID
EventType eventType; // See EventType enum
u64 clockTimestamp; // Time of event
u64 steadyTimestamp; // Steady timestamp (used for calculating duration)
PlayEventType type; // Type of PlayEvent
AccountUid userID; // UserID
TitleID titleID; // TitleID
EventType eventType; // See EventType enum
u64 clockTimestamp; // Time of event
u64 steadyTimestamp; // Steady timestamp (used for calculating duration)
};

// A PlaySession represents a session of play for a game. It contains the start
// and end timestamps and playtime for convenience. Note that (end-start) != playtime
// due to time when the game may not have been focussed.
struct PlaySession {
u32 playtime; // Total playtime in seconds
u64 playtime; // Total playtime in seconds
u64 startTimestamp; // Time of launch
u64 endTimestamp; // Time of exit
};

// PdmPlayStatistics but only the necessary things
struct PlayStatistics {
TitleID titleID; // TitleID of these stats
u32 firstPlayed; // Timestamp of first launch
u32 lastPlayed; // Timestamp of last play (exit)
u32 playtime; // Total playtime in seconds
u64 firstPlayed; // Timestamp of first launch
u64 lastPlayed; // Timestamp of last play (exit)
u64 playtime; // Total playtime in seconds
u32 launches; // Total launches
};

// RecentPlayStatistics struct is similar to PdmPlayStatistics but
// only contains recent values
struct RecentPlayStatistics {
TitleID titleID; // TitleID of these statistics
u32 playtime; // Total playtime in seconds
u64 playtime; // Total playtime in seconds
u32 launches; // Total launches
};

Expand Down Expand Up @@ -118,10 +118,10 @@ namespace NX {
// Returns all play sessions for the given title ID and user ID
std::vector<PlaySession> getPlaySessionsForUser(TitleID, AccountUid);

// Returns a RecentPlayStatistics for the given time range for all users
// Returns a RecentPlayStatistics for the given time range and user ID for all Title IDs
RecentPlayStatistics * getRecentStatisticsForUser(u64, u64, AccountUid);

// Returns a RecentPlayStatistics for the given time range and user ID
// Returns a RecentPlayStatistics for the given time range, user ID and title ID
RecentPlayStatistics * getRecentStatisticsForTitleAndUser(TitleID, u64, u64, AccountUid);

// Returns a PlayStatistics for the given titleID and userID
Expand Down
10 changes: 5 additions & 5 deletions Application/include/ui/element/SortedList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// Struct storing information about entry used for sorting
struct SortInfo {
std::string name; // Name of title
unsigned long long int titleID; // Title's ID
unsigned int firstPlayed; // Timestamp of first launch
unsigned int lastPlayed; // Timestamp of last play
unsigned int playtime; // Total playtime in seconds
unsigned int launches; // Total launches
u64 titleID; // Title's ID
u64 firstPlayed; // Timestamp of first launch
u64 lastPlayed; // Timestamp of last play
u64 playtime; // Total playtime in seconds
u32 launches; // Total launches
};

namespace CustomElm {
Expand Down
4 changes: 0 additions & 4 deletions Application/include/ui/screen/Details.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ namespace Screen {
// Used to udpate prev. screen
bool popped;

// Updates graph if data matching current time range
void updateGraph();
// Updates the list of play sessions matching current time range
void updateSessions();
// Element which marks top of sessions
Aether::Element * topElm;

Expand Down
4 changes: 0 additions & 4 deletions Application/include/ui/screen/RecentActivity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ namespace Screen {

// Updates the "recent activity" part of the screen
void updateActivity();
// Updates graph if data matching current time range
void updateGraph();
// Updates the list of games played underneath
void updateTitles();

// Element which marks top of sessions
Aether::Element * topElm;
Expand Down
17 changes: 17 additions & 0 deletions Application/include/utils/Debug.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once
#ifndef DEBUG_HPP
#define DEBUG_HPP

#include <string>
#include <cstdio>
#include <mutex>

//#define ENABLE_DEBUG
#define MAX_LOG_LEN 512

namespace Utils {
extern std::mutex mutex;
void write_log(const char *pszFmt, ...);
};

#endif
8 changes: 4 additions & 4 deletions Application/include/utils/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ namespace Utils {
std::string insertVersionInString(std::string, std::string);

// Format the given timestamp as 'last played' string
std::string lastPlayedToString(unsigned int);
std::string lastPlayedToString(uint64_t);

// Format the given number of launches into a string
std::string launchesToString(unsigned int);
std::string launchesToPlayedString(unsigned int);

// Format the given playtime (in seconds) into hours and minutes
std::string playtimeToString(unsigned int);
std::string playtimeToString(uint64_t);

// Format the given playtime (in seconds) into 'played for' string
std::string playtimeToPlayedForString(unsigned int);
std::string playtimeToPlayedForString(uint64_t);

// Format the given playtime (in seconds) into 'total playtime' string
std::string playtimeToTotalPlaytimeString(unsigned int);
std::string playtimeToTotalPlaytimeString(uint64_t);

// Merges two vectors into one (for sorting)
// Vector to merge into, two vectors to merge
Expand Down
2 changes: 1 addition & 1 deletion Application/libs/Aether
2 changes: 1 addition & 1 deletion Application/libs/SimpleIniParser
2 changes: 1 addition & 1 deletion Application/libs/json
Submodule json updated 2504 files
2 changes: 1 addition & 1 deletion Application/romfs/lang
Submodule lang updated 13 files
+1 −1 README.md
+46 −9 de.json
+1 −0 en.json
+44 −7 es.json
+6 −3 fr.json
+43 −6 it.json
+7 −7 ja.json
+15 −14 ko.json
+1 −0 pt-BR.json
+39 −2 ru.json
+38 −1 tr.json
+10 −9 zh-HANS.json
+9 −8 zh-HANT.json
10 changes: 5 additions & 5 deletions Application/source/Application.ExportJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace Main {
// Check if played, and if not move onto next
NX::RecentPlayStatistics * stats = this->app->playdata_->getRecentStatisticsForTitleAndUser(title->titleID(), std::numeric_limits<u64>::min(), std::numeric_limits<u64>::max(), user->ID());
bool recentLaunched = (stats->launches != 0);
delete stats;

// Add title metadata
tJson["name"] = title->name();
Expand Down Expand Up @@ -92,10 +91,11 @@ namespace Main {
// Get all summary stats
NX::PlayStatistics * stats2 = this->app->playdata_->getStatisticsForUser(title->titleID(), user->ID());
bool allLaunched = (stats2->launches != 0);
tJson["summary"]["firstPlayed"] = pdmPlayTimestampToPosix(stats2->firstPlayed);
tJson["summary"]["lastPlayed"] = pdmPlayTimestampToPosix(stats2->lastPlayed);
tJson["summary"]["playtime"] = stats2->playtime;
tJson["summary"]["launches"] = stats2->launches;
tJson["summary"]["firstPlayed"] = stats2->firstPlayed;
tJson["summary"]["lastPlayed"] = stats2->lastPlayed;
tJson["summary"]["playtime"] = stats->playtime;
tJson["summary"]["launches"] = stats->launches;
delete stats;
delete stats2;

// Append title if played at least once
Expand Down
4 changes: 2 additions & 2 deletions Application/source/Application.ImportJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ namespace Main {
nlohmann::json s = title["summary"];
if (s["firstPlayed"] != nullptr && s["lastPlayed"] != nullptr && s["playtime"] != nullptr && s["launches"] != nullptr) {
tJson["summary"] = nlohmann::json();
tJson["summary"]["firstPlayed"] = Utils::Time::posixTimestampToPdm(s["firstPlayed"].get<uint64_t>());
tJson["summary"]["lastPlayed"] = Utils::Time::posixTimestampToPdm(s["lastPlayed"].get<uint64_t>());
tJson["summary"]["firstPlayed"] = s["firstPlayed"].get<uint64_t>();
tJson["summary"]["lastPlayed"] = s["lastPlayed"].get<uint64_t>();
tJson["summary"]["playtime"] = s["playtime"];
tJson["summary"]["launches"] = s["launches"];
}
Expand Down
9 changes: 8 additions & 1 deletion Application/source/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ namespace Main {
this->gLang_ = Chinese;
} else if (option->value == "Korean") {
this->gLang_ = Korean;
} else if (option->value == "Japanese") {
this->gLang_ = Japanese;
} else {
this->gLang_ = Default;
}
Expand Down Expand Up @@ -125,7 +127,10 @@ namespace Main {
std::ifstream file("/config/NX-Activity-Log/hidden.conf");
std::string line;
while (file >> line) {
this->hidden.push_back(Utils::stringToU64(line));
uint64_t hiddenTitle = Utils::stringToU64(line);
if (hiddenTitle != 0) {
this->hidden.push_back(hiddenTitle);
}
}

// Read in adjustment values
Expand Down Expand Up @@ -186,6 +191,8 @@ namespace Main {
option->value = "Chinese";
} else if (this->gLang_ == Korean) {
option->value = "Korean";
} else if (this->gLang_ == Japanese) {
option->value = "Japanese";
}

option = ini->findSection("general")->findFirstOption("showGraphValues");
Expand Down
4 changes: 4 additions & 0 deletions Application/source/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ std::string toString(Language l) {
case Language::Korean:
str = "한국어";
break;

case Language::Japanese:
str = "日本語";
break;

default:
break;
Expand Down
Loading