mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:14:37 +02:00
Media: remove the alias name Song to avoid confusion
So we don't have code like `#define FF_SONG_MODULE_NAME "Media"`. Also fix the error `unknown option: --media-format`
This commit is contained in:
+7
-1
@@ -1,3 +1,9 @@
|
||||
# 1.8.1
|
||||
|
||||
Notable Changes:
|
||||
|
||||
* `Song` was used as an alias to `Media` module. It's removed to avoid confusion. All song related flags (`--song-key`, etc) should change to media (`--media-key`, etc).
|
||||
|
||||
# 1.8.0
|
||||
|
||||
This release introduces Windows support! Fastfetch now fully support all major desktop OSes (Linux, macOS, Windows and FreeBSD)
|
||||
@@ -72,7 +78,7 @@ Features:
|
||||
* MacPorts package manager support (@SladeGetz, #234)
|
||||
* Battery support for MacOS (@CarterLi, #235)
|
||||
* Processes, swap & terminal font support for MacOS(@CarterLi, #237)
|
||||
* Song support for MacOS (@CarterLi, #242)
|
||||
* Media support for MacOS (@CarterLi, #242)
|
||||
* Player support for MacOS (@CarterLi, #245)
|
||||
* WM theme support for MacOS (@CarterLi, #246)
|
||||
* CPU usage support for MacOS (@CarterLi, #247)
|
||||
|
||||
+1
-1
@@ -284,7 +284,7 @@ set(LIBFASTFETCH_SRC
|
||||
src/modules/resolution.c
|
||||
src/modules/separator.c
|
||||
src/modules/shell.c
|
||||
src/modules/song.c
|
||||
src/modules/media.c
|
||||
src/modules/terminal.c
|
||||
src/modules/terminalfont.c
|
||||
src/modules/theme.c
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
--structure Title:Separator:OS:Host:Bios:Board:Chassis:Kernel:Uptime:Processes:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:CPUUsage:GPU:Memory:Swap:Disk:Battery:PowerAdapter:Player:Song:PublicIP:LocalIP:Wifi:DateTime:Locale:Vulkan:OpenGL:OpenCL:Users:Weather:Break:Colors
|
||||
--structure Title:Separator:OS:Host:Bios:Board:Chassis:Kernel:Uptime:Processes:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:CPUUsage:GPU:Memory:Swap:Disk:Battery:PowerAdapter:Player:Media:PublicIP:LocalIP:Wifi:DateTime:Locale:Vulkan:OpenGL:OpenCL:Users:Weather:Break:Colors
|
||||
|
||||
+2
-2
@@ -193,7 +193,7 @@ static void defaultConfig(FFinstance* instance)
|
||||
initModuleArg(&instance->config.weather);
|
||||
initModuleArg(&instance->config.wifi);
|
||||
initModuleArg(&instance->config.player);
|
||||
initModuleArg(&instance->config.song);
|
||||
initModuleArg(&instance->config.media);
|
||||
initModuleArg(&instance->config.dateTime);
|
||||
initModuleArg(&instance->config.date);
|
||||
initModuleArg(&instance->config.time);
|
||||
@@ -425,7 +425,7 @@ static void destroyConfig(FFinstance* instance)
|
||||
destroyModuleArg(&instance->config.weather);
|
||||
destroyModuleArg(&instance->config.wifi);
|
||||
destroyModuleArg(&instance->config.player);
|
||||
destroyModuleArg(&instance->config.song);
|
||||
destroyModuleArg(&instance->config.media);
|
||||
destroyModuleArg(&instance->config.dateTime);
|
||||
destroyModuleArg(&instance->config.date);
|
||||
destroyModuleArg(&instance->config.time);
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
#--wifi-key Wifi
|
||||
#--weather-key Weather
|
||||
#--player-key Media Player
|
||||
#--song-key Song
|
||||
#--media-key Media
|
||||
#--datetime-key Date Time
|
||||
#--vulkan-key Vulkan
|
||||
#--opengl-key OpenGL
|
||||
@@ -290,7 +290,7 @@
|
||||
#--public-ip-format
|
||||
#--weather-format
|
||||
#--player-format
|
||||
#--song-format
|
||||
#--media-format
|
||||
#--datetime-format
|
||||
#--vulkan-format
|
||||
#--opengl-format
|
||||
@@ -333,7 +333,7 @@
|
||||
#--public-ip-error
|
||||
#--weather-error
|
||||
#--player-error
|
||||
#--song-error
|
||||
#--media-error
|
||||
#--datetime-error
|
||||
#--vulkan-error
|
||||
#--opengl-error
|
||||
|
||||
@@ -18,6 +18,7 @@ Icons
|
||||
Kernel
|
||||
Locale
|
||||
LocalIP
|
||||
Media
|
||||
Memory
|
||||
OpenGL
|
||||
OS
|
||||
@@ -29,7 +30,6 @@ PublicIP
|
||||
Resolution
|
||||
Separator
|
||||
Shell
|
||||
Song
|
||||
Swap
|
||||
Terminal
|
||||
TerminalFont
|
||||
|
||||
+5
-5
@@ -389,9 +389,9 @@ static inline void printCommandHelp(const char* command)
|
||||
"URL name"
|
||||
);
|
||||
}
|
||||
else if(strcasecmp(command, "song-format") == 0 || strcasecmp(command, "media-format") == 0)
|
||||
else if(strcasecmp(command, "media-format") == 0)
|
||||
{
|
||||
constructAndPrintCommandHelpFormat("song", "{3} - {1}", 4,
|
||||
constructAndPrintCommandHelpFormat("media", "{3} - {1}", 4,
|
||||
"Pretty media name",
|
||||
"Media name",
|
||||
"Artist name",
|
||||
@@ -1122,7 +1122,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
|
||||
else if(optionParseModuleArgs(key, value, "public-ip", &instance->config.publicIP)) {}
|
||||
else if(optionParseModuleArgs(key, value, "weather", &instance->config.weather)) {}
|
||||
else if(optionParseModuleArgs(key, value, "player", &instance->config.player)) {}
|
||||
else if(optionParseModuleArgs(key, value, "song", &instance->config.song)) {}
|
||||
else if(optionParseModuleArgs(key, value, "media", &instance->config.media)) {}
|
||||
else if(optionParseModuleArgs(key, value, "datetime", &instance->config.dateTime)) {}
|
||||
else if(optionParseModuleArgs(key, value, "date", &instance->config.date)) {}
|
||||
else if(optionParseModuleArgs(key, value, "time", &instance->config.time)) {}
|
||||
@@ -1380,8 +1380,8 @@ static void parseStructureCommand(FFinstance* instance, FFdata* data, const char
|
||||
ffPrintWeather(instance);
|
||||
else if(strcasecmp(line, "player") == 0)
|
||||
ffPrintPlayer(instance);
|
||||
else if(strcasecmp(line, "media") == 0 || strcasecmp(line, "song") == 0)
|
||||
ffPrintSong(instance);
|
||||
else if(strcasecmp(line, "media") == 0)
|
||||
ffPrintMedia(instance);
|
||||
else if(strcasecmp(line, "datetime") == 0)
|
||||
ffPrintDateTime(instance);
|
||||
else if(strcasecmp(line, "date") == 0)
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ typedef struct FFconfig
|
||||
FFModuleArgs publicIP;
|
||||
FFModuleArgs weather;
|
||||
FFModuleArgs player;
|
||||
FFModuleArgs song;
|
||||
FFModuleArgs media;
|
||||
FFModuleArgs dateTime;
|
||||
FFModuleArgs date;
|
||||
FFModuleArgs time;
|
||||
@@ -288,7 +288,7 @@ void ffPrintBattery(FFinstance* instance);
|
||||
void ffPrintPowerAdapter(FFinstance* instance);
|
||||
void ffPrintLocale(FFinstance* instance);
|
||||
void ffPrintPlayer(FFinstance* instance);
|
||||
void ffPrintSong(FFinstance* instance);
|
||||
void ffPrintMedia(FFinstance* instance);
|
||||
void ffPrintDateTime(FFinstance* instance);
|
||||
void ffPrintDate(FFinstance* instance);
|
||||
void ffPrintTime(FFinstance* instance);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ int main(int argc, char** argv)
|
||||
ffPrintBattery(&instance);
|
||||
ffPrintPowerAdapter(&instance);
|
||||
//ffPrintPlayer(&instance);
|
||||
//ffPrintSong(&instance);
|
||||
//ffPrintMedia(&instance);
|
||||
//ffPrintLocalIp(&instance);
|
||||
//ffPrintPublicIp(&instance);
|
||||
//ffPrintWifi(&instance);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#define FF_SONG_MODULE_NAME "Media"
|
||||
#define FF_SONG_NUM_FORMAT_ARGS 5
|
||||
#define FF_MEDIA_MODULE_NAME "Media"
|
||||
#define FF_MEDIA_NUM_FORMAT_ARGS 5
|
||||
|
||||
static bool shouldIgoreChar(char c)
|
||||
{
|
||||
@@ -42,13 +42,13 @@ static bool artistInSongTitle(const FFstrbuf* song, const FFstrbuf* artist)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ffPrintSong(FFinstance* instance)
|
||||
void ffPrintMedia(FFinstance* instance)
|
||||
{
|
||||
const FFMediaResult* media = ffDetectMedia(instance);
|
||||
|
||||
if(media->error.length > 0)
|
||||
{
|
||||
ffPrintError(instance, FF_SONG_MODULE_NAME, 0, &instance->config.song, "%s", media->error.chars);
|
||||
ffPrintError(instance, FF_MEDIA_MODULE_NAME, 0, &instance->config.media, "%s", media->error.chars);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void ffPrintSong(FFinstance* instance)
|
||||
if(songPretty.length == 0)
|
||||
ffStrbufAppend(&songPretty, &media->song);
|
||||
|
||||
if(instance->config.song.outputFormat.length == 0)
|
||||
if(instance->config.media.outputFormat.length == 0)
|
||||
{
|
||||
//We don't expose artistPretty to the format, as it might be empty (when the think that the artist is already in the song title)
|
||||
FFstrbuf artistPretty;
|
||||
@@ -81,7 +81,7 @@ void ffPrintSong(FFinstance* instance)
|
||||
if(artistInSongTitle(&songPretty, &artistPretty))
|
||||
ffStrbufClear(&artistPretty);
|
||||
|
||||
ffPrintLogoAndKey(instance, FF_SONG_MODULE_NAME, 0, &instance->config.song.key);
|
||||
ffPrintLogoAndKey(instance, FF_MEDIA_MODULE_NAME, 0, &instance->config.media.key);
|
||||
|
||||
if(artistPretty.length > 0)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ void ffPrintSong(FFinstance* instance)
|
||||
}
|
||||
else
|
||||
{
|
||||
ffPrintFormat(instance, FF_SONG_MODULE_NAME, 0, &instance->config.song, FF_SONG_NUM_FORMAT_ARGS, (FFformatarg[]){
|
||||
ffPrintFormat(instance, FF_MEDIA_MODULE_NAME, 0, &instance->config.media, FF_MEDIA_NUM_FORMAT_ARGS, (FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &songPretty},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &media->song},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &media->artist},
|
||||
Reference in New Issue
Block a user