Skip to content

Commit

Permalink
???
Browse files Browse the repository at this point in the history
  • Loading branch information
booploops committed Jun 27, 2024
2 parents 08ac26a + c8d0482 commit 354bd7d
Show file tree
Hide file tree
Showing 6 changed files with 3,839 additions and 3,829 deletions.
138 changes: 138 additions & 0 deletions .github/workflows/build-win-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: "Build Windows/ Linux / ARM macOS"

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18.x
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a single command using the runners shell
- name: Install Dependencies
run: |
yarn install
yarn add git+https://github.com/ciderapp/prebuild.git
# Runs a set of commands using the runners shell
- name: Build binaries
run: yarn run build-binaries-electron

# Runs a set of commands using the runners shell
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: linux
# A file, directory or wildcard pattern that describes what to upload
path: ./prebuilds/*.tar.gz

build-windows:
# The type of runner that the job will run on
runs-on: windows-2019

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18.x
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a single command using the runners shell
- name: Install Dependencies
run: |
npm config set msvs_version 2019
yarn install
yarn add git+https://github.com/ciderapp/prebuild.git
# Runs a set of commands using the runners shell
- name: Build binaries
run: yarn run build-binaries-electron

- name: Build executable
run: yarn exe

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: windows
# A file, directory or wildcard pattern that describes what to upload
path: |
./prebuilds/*.tar.gz
./airtunes2.exe
build-macos:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18.x
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# # Runs a single command using the runners shell
# - name: Install buildtools
# run: brew install autoconf automake libtool

# Runs a single command using the runners shell
- name: Install Dependencies
run: |
yarn install
yarn add git+https://github.com/ciderapp/prebuild.git
# Runs a set of commands using the runners shell
- name: Build binaries
run: yarn run build-binaries-electron

- name: Build binaries (ARM)
run: yarn run build-binaries-electron2

# Runs a set of commands using the runners shell
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: macos
# A file, directory or wildcard pattern that describes what to upload
path: ./prebuilds/*.tar.gz

final:
runs-on: ubuntu-latest
needs: [build-linux, build-macos, build-windows]
steps:
- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R

- name: Release Artifact
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v2.4.9"
prerelease: false
files: |
./windows/airtunes2.exe
./**/*.tar.gz
61 changes: 34 additions & 27 deletions examples/ccast/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,26 @@ Chromecast.prototype.setTrackInfo = function (
console.log('setTrackInfoInt', this.metadata);
if (host == "all") {
for (const [key, value] of Object.entries(this.activeConnections)) {
value.session.setMetadata(
song,
artist,
album,
artworkURL
);
try {
value.session.setMetadata(
song,
artist,
album,
artworkURL
);
} catch (e) {}
}
} else {
if (this.activeConnections[host]) {
this.activeConnections[host].session.setMetadata(
song,
artist,
album,
artworkURL
);
}
try {
if (this.activeConnections[host]) {
this.activeConnections[host].session.setMetadata(
song,
artist,
album,
artworkURL
);
}
} catch (e) {}
}
}
};
Expand All @@ -288,19 +292,21 @@ Chromecast.prototype.setArtwork = function (host, artworkURL) {
console.log('setArtworkInt', this.metadata);
this.metadata.albumart = artworkURL;
if (host == "all") {
for (const [key, value] of Object.entries(this.activeConnections)) {
value.session.setMetadata(
'',' ','',''
);
value.session.setMetadata(
this.metadata.name,
this.metadata.artistName,
this.metadata.albumName,
this.metadata.albumart
);
}
try {
for (const [key, value] of Object.entries(this.activeConnections)) {
value.session.setMetadata(
'',' ','',''
);
value.session.setMetadata(
this.metadata.name,
this.metadata.artistName,
this.metadata.albumName,
this.metadata.albumart
);
}
} catch (e) {}
} else {

try {
if (this.activeConnections[host]) {
this.activeConnections[host].session.setMetadata(
'',' ','',''
Expand All @@ -311,7 +317,8 @@ Chromecast.prototype.setArtwork = function (host, artworkURL) {
this.metadata.albumName,
this.metadata.albumart
);
}}
}} catch (e) {}}

}
};

Expand Down
35 changes: 20 additions & 15 deletions examples/play_stdin.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,24 +352,29 @@ function ondeviceup(name, host, port, addresses, text, airplay2 = null, devicety
}

function getIp() {
let ip = "";
let ip2 = [];
let alias = 0;
const ifaces= os.networkInterfaces();
for (let dev in ifaces) {
ifaces[dev].forEach((details) => {
if (details.family === "IPv4" && !details.internal) {
if (!/(loopback|vmware|internal|hamachi|vboxnet|virtualbox)/gi.test(dev + (alias ? ":" + alias : ""))) {
if (details.address.substring(0, 8) === "192.168." || details.address.substring(0, 7) === "172.16." || details.address.substring(0, 3) === "10.") {
if (!ip.startsWith("192.168.") || (ip2.startsWith("192.168.") && !ip.startsWith("192.168.") && ip2.startsWith("172.16.") && !ip.startsWith("192.168.") && !ip.startsWith("172.16.")) || (ip2.startsWith("10.") && !ip.startsWith("192.168.") && !ip.startsWith("172.16.") && !ip.startsWith("10."))) {
ip = details.address;
try {
let ip = "";
let ip2 = [];
let alias = 0;
const ifaces = os.networkInterfaces();
for (let dev in ifaces) {
ifaces[dev].forEach((details) => {
if (details.family === "IPv4" && !details.internal) {
if (!/(loopback|vmware|internal|hamachi|vboxnet|virtualbox)/gi.test(dev + (alias ? ":" + alias : ""))) {
if (details.address.substring(0, 8) === "192.168." || details.address.substring(0, 7) === "172.16." || details.address.substring(0, 3) === "10.") {
if (!ip.startsWith("192.168.") || (ip2.startsWith("192.168.") && !ip.startsWith("192.168.") && ip2.startsWith("172.16.") && !ip.startsWith("192.168.") && !ip.startsWith("172.16.")) || (ip2.startsWith("10.") && !ip.startsWith("192.168.") && !ip.startsWith("172.16.") && !ip.startsWith("10."))) {
ip = details.address;
}
++alias;
}
++alias;
}
}
}
});
});
}
return ip;
} catch (_) {
return ip.address();
}
return ip;
}


Loading

0 comments on commit 354bd7d

Please sign in to comment.