Skip to content

Commit

Permalink
repository source code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
XFG16 committed Jun 1, 2022
1 parent 8222d76 commit 094453a
Show file tree
Hide file tree
Showing 25 changed files with 18 additions and 22 deletions.
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
Host/Discord/Compiled/
Host/main.dSYM
Host/log.txt
Extension.zip
.DS_Store
Extension/.DS_Store
.vs
.DS_Store
Host/YTDPwin/x64
Host/YTDPwin/YTDPwin/log.txt
Host/YTDPwin/YTDPwin/x64
DesktopTemplate
Host/YTDPwin/UpgradeLog.htm
Host/YTDPwin/UpgradeLog2.htm
Host/YTDPwin/YTDPsetup/Debug
Host/YTDPwin/YTDPsetup/Debug
Host/YTDPwin/YTDPsetup/Release
.vscode
.vs
*.o
*.msi
*.exe
*.out
3 changes: 2 additions & 1 deletion Extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const NMF = { // NMF = NATIVE_MESSAGE_FORMAT
}

const IDLE_TIME_REQUIREMENT = 3000;
const NORMAL_MESSAGE_DELAY = 1000;
const LIVESTREAM_TIME_ID = -1;

var nativePort = chrome.runtime.connectNative("com.ytdp.discord.presence");
Expand Down Expand Up @@ -45,7 +46,7 @@ var pipeInterval = setInterval(function() {
}
nativePort.postMessage(NMF.TITLE + NMF.IDLE + NMF.AUTHOR + NMF.IDLE + NMF.TIME_LEFT + NMF.IDLE + NMF.END);
}
else if (new Date().getTime() - lastUpdated < IDLE_TIME_REQUIREMENT + 500) {
else if (new Date().getTime() - lastUpdated < NORMAL_MESSAGE_DELAY + 500) {
if (LOGGING) {
console.log("[CURRENTMESSAGE] SENT BY BACKGROUND.JS: ['" + currentMessage.title + "', '" + currentMessage.author + "', '" + currentMessage.timeLeft + "']");
}
Expand Down
2 changes: 1 addition & 1 deletion Extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "YouTubeDiscordPresence",
"author": "Michael Ren",
"description": "An extension used to create a detailed rich presence for YouTube videos and livestreams on Discord.",
"version": "1.1",
"version": "1.2",
"manifest_version": 3,
"content_scripts": [
{
Expand Down
Binary file removed Host/Discord/Compiled/achievement_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/activity_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/application_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/core.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/image_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/lobby_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/main.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/network_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/overlay_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/relationship_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/storage_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/store_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/types.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/user_manager.o
Binary file not shown.
Binary file removed Host/Discord/Compiled/voice_manager.o
Binary file not shown.
Binary file removed Host/YTDPwin/YTDPsetup/Release/YTDPsetup.msi
Binary file not shown.
Binary file removed Host/YTDPwin/YTDPsetup/Release/setup.exe
Binary file not shown.
5 changes: 1 addition & 4 deletions Host/YTDPwin/YTDPwin/YTDPwin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
<ClInclude Include="..\..\Discord\API\types.h" />
<ClInclude Include="..\..\Discord\API\user_manager.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\main.json" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
Expand Down Expand Up @@ -178,7 +175,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\Discord\Lib\x86_64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);C:\repos\YouTubeDiscordPresence\Host\Discord\Lib\discord_game_sdk.dll.lib</AdditionalDependencies>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);..\..\Discord\Lib\discord_game_sdk.dll.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
5 changes: 0 additions & 5 deletions Host/YTDPwin/YTDPwin/YTDPwin.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,4 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\main.json">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>
Empty file removed Host/YTDPwin/YTDPwin/log.txt
Empty file.
2 changes: 1 addition & 1 deletion Host/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void updatePresence(const std::string& title, const std::string& author, const s
activityAssets.SetLargeText(titleCString);
activity.SetState(authorCString);
activityAssets.SetSmallImage("githubmark2");
activityAssets.SetSmallText("YouTubeDiscordPresence on GitHub by XFG16 (2309#2309)");
activityAssets.SetSmallText("YouTubeDiscordPresence on GitHub by XFG16 (2309#2309)"); // keep this here please, so others can find the extension

previousTimeLeft = timeLeft;
bool presenceUpdated = false, entered = false;
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@

# Installation (no need to download additional libraries)
1. Download the `YTDPsetup.msi` file in the [**<ins>releases section</ins>**](https://github.com/XFG16/YouTubeDiscordPresence/releases/tag/1.0) and run it on your computer
- It's gonna say Windows **blocked an unknown app** because the publisher is unknown. Sorry, I'm broke and can't afford a digital certificate, at least for now. Just click more info and run anyway.
- If you run this through VirusTotal, there are gonna be several **false positives**. Sorry, but my word is the only thing I can really offer here.
- Otherwise, you can just **build** the whole thing yourself with **Visual Studio 2022**. Just open the `YTDPwin.sln` file under `Host/YTDPwin` and link the Discord Game SDK, `main.cpp`, and `main.json`, and you should be set. See below for more details on linking the Discord Game SDK.
- It's gonna say Windows **blocked an unknown app** because the publisher is unknown. Just click more info and run anyway. If you run this through VirusTotal, there are gonna be several **false positives**. Sorry, but my word is the only thing I can really offer here since at the moment, I can't purchase a digital certificate.
- Otherwise, you can just **build** the whole thing yourself with **Visual Studio 2022**. Just download the `Host` directory from this repository and run `YouTubeDiscordPresence.sln`. Also, make sure to have the **Microsoft Visual Studio Installer Project** installed as an extension in Visual Studio.
2. Add the [<ins>**Chrome Extension**</ins>](https://chrome.google.com/webstore/detail/youtubediscordpresence/hnmeidgkfcbpjjjpmjmpehjdljlaeaaa) from the **Chrome Web Store** and turn it on **after installing the desktop component.** If you installed the extension before installing the desktop component, just turn it **off and back on** after the desktop component is installed.
3. You should be all set and ready to go! To turn this application **on or off**, just go to `chrome://extensions` and **toggle the switch** for the extension

Expand Down Expand Up @@ -42,5 +41,4 @@
- REMEMBER TO **TURN OFF LOGGING** FOR RELEASE VERSIONS
- Press `Alt` + `Enter` to show properties in Visual Studio
- Maybe add a feature to stop the presence from disappearing when no video is playing; instead, just make the rich presence display idle (let the user choose between original or this)
- Maybe have presence display a different icon for YouTube Music
- For linking the Discord Game SDK to Visual Studio, go to `[PROJECT NAME ON EXPLORER] > Properties > Linker > Input > Additional Dependencies` and add the exact path to the `.lib` file associated with the `.dll` file
- Maybe have presence display a different icon for YouTube Music

0 comments on commit 094453a

Please sign in to comment.