This commit is contained in:
Seth Call 2025-04-01 19:37:41 -05:00
parent d1b9c8b19a
commit a1d60e7b8a
5 changed files with 226 additions and 1 deletions

View File

@ -5,6 +5,25 @@ class Spacer
('%-5.5s' % percentage).gsub(' ', ' ') + '% - ' + val.to_s
end
end
=begin
select
count(id) as total,
count(first_downloaded_client_at) as downloaded,
count(first_ran_client_at) as ran_client,
count(first_certified_gear_at) as ftue,
count(first_music_session_at) as any_session,
count(first_real_music_session_at) as real_session,
count(first_good_music_session_at) as good_session,
count(first_invited_at) as invited,
count(first_friended_at) as friended,
count(first_subscribed_at) as subscribed
from users where users.created_at >= '2024-11-01' AND users.created_at < '2025-04-01'
select first_name, last_name, email
from users where users.created_at >= '2024-11-01' AND users.created_at < '2025-04-01'
AND first_music_session_at is NULL;
=end
ActiveAdmin.register_page "Subscription Cohorts" do
menu :parent => 'Reports'

View File

@ -112,6 +112,19 @@ class Cohort < ActiveRecord::Base
def self.cohort_users(cohort)
User.where(created_at: cohort.group_start..cohort.group_end)
end
=begin
SELECT played.user_id FROM
(SELECT user_id, COUNT(*) cnt FROM music_sessions_user_history msuh1
WHERE
msuh1.created_at >= '2024-11-01' AND
msuh1.created_at <= '202' AND
EXTRACT(EPOCH FROM (msuh1.session_removed_at - msuh1.created_at)) >= 900 AND
(SELECT COUNT(*) FROM music_sessions_user_history msuh2
WHERE msuh1.music_session_id = msuh2.music_session_id
) > 1
GROUP BY user_id
) played
=end
def _played_online_subquery(constraint)
where = if constraint.is_a?(Range)

View File

@ -0,0 +1,188 @@
import React, { useState, useEffect } from 'react'
import { detectOS, isAppleSilicon } from '../../helpers/utils'
import { getClientDownloads } from '../../helpers/rest'
import { Link } from 'react-router-dom'
const DownloadButtonMacAppleMx = '/img/downloads/Download-Button-Obs-Mac-Apple-Mx.svg'
const DownloadButtonMacIntel = '/img/downloads/Download-Button-Obs-Mac-Intel.svg'
const DownloadButtonWindows = '/img/downloads/Download-Button-Obs-Windows.svg'
const JKDownloads = () => {
const [currentOS, setCurrentOS] = useState(null)
const [downloads, setDownloads] = useState({})
const availablePlatforms = React.useMemo(() => {
const keys = Object.keys(downloads)
//only show JamClientModern versions
const sortedStrings = keys.filter(key => key.startsWith('JamClientModern') && key !== 'MacOSX').map(key => key.substring('JamClientModern/'.length))
return sortedStrings
}, [downloads])
const detectAndSetOS = () => {
let os = detectOS()
if (os == "MacOSX") {
const silicon = isAppleSilicon();
if (silicon == true) {
os = "MacOSX-M";
}
else {
os = "MacOSX-Intel";
}
}
if (!os) {
os = "Win32"
}
setCurrentOS(os)
}
const fetchClientDownloads = () => {
getClientDownloads()
.then(resp => {
if (resp.status === 200) {
return resp.json()
}
}).then(data => {
const platforms = Object.keys(data)
const downloadUris = {}
platforms.filter(p => p === 'JamClientModern/MacOSX-M' || p === 'JamClientModern/MacOSX-Intel' || p === 'JamClientModern/Win32').forEach(platform => {
downloadUris[platform] = data[platform].uri
})
setDownloads(downloadUris)
detectAndSetOS()
})
.catch(err => {
console.error(err)
})
}
useEffect(() => {
fetchClientDownloads()
}, [])
const downloadLink = React.useMemo(() => {
if (!currentOS) return null
return downloads[`JamClientModern/${currentOS}`]
}, [currentOS]);
const selectPlatform = (platform) => {
console.log('_DEBUG_ platform', platform)
setCurrentOS(platform)
}
const downloadImageUrl = React.useMemo(() => {
if (!currentOS) return null
switch (currentOS) {
case 'MacOSX-M':
return DownloadButtonMacAppleMx
case 'MacOSX-Intel':
return DownloadButtonMacIntel
case 'Win32':
return DownloadButtonWindows
}
}, [currentOS])
const isMacOS = React.useMemo(() => {
if (!currentOS) return false
return currentOS.startsWith('MacOSX')
}, [currentOS])
const isWindows = React.useMemo(() => {
if (!currentOS) return false
return currentOS === 'Win32'
}, [currentOS])
const platformDisplayName = (platform) => {
switch (platform) {
case 'MacOSX-M':
return 'JamKazam for Mac (Apple Silicon)'
case 'MacOSX-Intel':
return 'JamKazam for Mac (Intel)'
case 'Win32':
return 'JamKazam for Windows'
}
}
const onClickPlatform = (event, platform) => {
event.preventDefault()
selectPlatform(platform)
}
return (
<>
{Object.keys(downloads).length > 0 && currentOS ? (
<div>
<h5>Download the free JamKazam app</h5>
{/* <p>{currentOS}</p> */}
<p>
You must use the JamKazam app to get into online sessions with other musicians. Our app also gives you the most feature-rich experience for JamTracks, recordings, live broadcasting, and other features. Click the button below to download the JamKazam app installer, then double click the installer to run it. For more detailed instructions,&nbsp;
{isMacOS ? <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000130025" target='_blank'>see this help article</a> : isWindows && <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000130024" target="_blank">see this help article</a>}.
</p>
<div className='mt-2 d-flex flex-column flex-md-row'>
<div style={ { flexGrow: 0, flexShrink: 0, flexBasis: '25%' } }>
<a href={downloadLink} target='_blank'>
<img src={downloadImageUrl} alt="Download JamKazam" />
</a>
</div>
<div className='mt-3 mt-lg-0 ml-lg-3' style={ { flexGrow: 1, flexShrink: 1, flexBasis: '75%' } }>
<div>Need a different version?</div>
<ul className='list-unstyled'>
{availablePlatforms.filter(platform => platform !== currentOS).map(platform => (
<li key={platform}><a href="#" onClick={(e) => onClickPlatform(e, platform)}>{platformDisplayName(platform)}</a></li>
))}
</ul>
</div>
</div>
<div className='mt-1 mt-lg-4'>
<div><strong>System Requirements</strong></div>
{isMacOS ? (
<p>
To play an online session on JamKazam, you will need the following:<br />
- macOS 10.15 (Catalina) or higher <br />
- 75MB hard disk space for app installation <br />
- External audio interface for audio processing (<a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122513" target='_blank'>see recommendations if you don't have one</a>) <br />
- Ability to connect computer to home router using Ethernet cable. WiFi not recommended (<a href='https://jamkazam.freshdesk.com/support/solutions/articles/66000124756' target='_blank'>learn how to do this</a>) <br />
- Broadband internet service with at least 1Mbps download and upload bandwidth (3-5Mbps preferred) <br />
</p>
) : isWindows ? (
<p>
To play an online session on JamKazam, you will need the following:<br />
- Windows 10 or 11, 64-bit (32-bit not supported) <br />
- Dual core processor or higher (quad or higher preferred) <br />
- 75MB hard disk space for app installation <br />
- External audio interface for audio processing (<a href='https://jamkazam.freshdesk.com/support/solutions/articles/66000122514' target='_blank'>see recommendations if you don't have one</a>) <br />
- Ability to connect computer to home router using Ethernet cable, WiFi not recommended (<a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000124756" target='_blank'>learn how to do this</a>) <br />
- Broadband Internet service with at least 1Mbps download and upload bandwidth (3-5Mbps preferred)
</p>
) : null}
</div>
{isMacOS ? (
<div>
<div><strong>Instructions for Users With Older Macs</strong></div>
<p>
If your Mac cannot support macOS 10.15 (Catalina) or higher, you can still play with everyone else on JamKazam using our legacy app. To do this, <Link to="/public/downloads-legacy">click here</Link> to go to a page where you can download JamKazam legacy app for older Macs. Download and install legacy app on your computer. Then <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000526271" target='_blank'>read this help article</a> about how to use the legacy app.
</p>
</div>
) : isWindows ? (
<div>
<div><strong>Instructions for Users With Older Windows PCs</strong></div>
<p>
If your Windows computer cannot support Win10 or Win11, you can still play with everyone else on JamKazam using our legacy app. To do this <Link to="/public/downloads-legacy">click here</Link> to go to a page where you can download the JamKazam legacy app for older Windows PCs. Download and install the legacy app on your Win7 computer. Then <a href="https://jamkazam.freshdesk.com/support/solutions/articles/66000526271" target='_blank'>read this help article</a> about how to use the legacy app.
</p>
</div>
) : null}
</div>
) : (
<div>Loading...</div>
)}
</>
)
}
export default JKDownloads

View File

@ -24,6 +24,7 @@ const JKPublicRoutes = ({ match: { url } }) => (
<Route path={`${url}/unsubscribe`} exact component={JKUnsubscribe} />
<Route path={`${url}/downloads`} exact component={JKDownloads} />
<Route path={`${url}/downloads-legacy`} exact component={JKDownloadsLegacy} />
<Route path={`${url}/obs-plugin-download`} exact component={JkObsDownloads} />
<Route path={`${url}/backing-tracks/:artist/:song`} component={JKJamTracksLanding} />
<Route path={`${url}/backing-tracks/:artist`} component={JKJamTracksArtistLanding} />

View File

@ -4,6 +4,7 @@ module JamRuby
DEFAULT_ENVIRONMENT = 'public'
CLIENT_PREFIX = 'JamClient'
CLIENT_PREFIX_MODERN = 'JamClientModern'
OBS_PLUGIN_PREFIX = 'OBSPlugin'
PRODUCTS = [
"#{CLIENT_PREFIX}/Win32",
@ -13,7 +14,10 @@ module JamRuby
"#{CLIENT_PREFIX_MODERN}/Win32",
"#{CLIENT_PREFIX_MODERN}/MacOSX-Intel",
"#{CLIENT_PREFIX_MODERN}/MacOSX-M",
"#{CLIENT_PREFIX_MODERN}/MacOSX"
"#{CLIENT_PREFIX_MODERN}/MacOSX",
"#{OBS_PLUGIN_PREFIX}/Win32",
"#{OBS_PLUGIN_PREFIX}/MacOSX-Intel",
"#{OBS_PLUGIN_PREFIX}/MacOSX-M",
]
self.primary_key = 'id'