diff --git a/git-teaspeak b/git-teaspeak index cba03a6..d9aa184 160000 --- a/git-teaspeak +++ b/git-teaspeak @@ -1 +1 @@ -Subproject commit cba03a6316db76fdf056a960ee509ad20542ea44 +Subproject commit d9aa18444b8f1322862d8c74123ab6d72b270592 diff --git a/license/server/DatabaseHandler.cpp b/license/server/DatabaseHandler.cpp index 43f14b9..9038ff2 100644 --- a/license/server/DatabaseHandler.cpp +++ b/license/server/DatabaseHandler.cpp @@ -533,7 +533,7 @@ std::deque> DatabaseHa bool DatabaseHandler::register_license_upgrade(license_key_id_t old_key_id, license_key_id_t new_key_id, const std::chrono::system_clock::time_point &begin_timestamp, const std::chrono::system_clock::time_point &end_timestamp, const std::string &license_key) { - auto upgrade_id = std::chrono::system_clock::now().time_since_epoch().count(); + auto upgrade_id = std::chrono::ceil(std::chrono::system_clock::now().time_since_epoch()).count(); auto sql_result = sql::command(this->sql(), "INSERT INTO `license_upgrades` (`upgrade_id`, `old_key_id`, `new_key_id`, `timestamp_begin`, `timestamp_end`, `valid`, `use_count`, `license`) VALUES" "(:upgrade_id, :old_key_id, :new_key_id, :timestamp_begin, :timestamp_end, 1, 0, :license)", variable{":upgrade_id", upgrade_id}, diff --git a/music b/music index ad24c38..8a896f7 160000 --- a/music +++ b/music @@ -1 +1 @@ -Subproject commit ad24c38923afe23d94452973337a416540e3c7aa +Subproject commit 8a896f7a797251b8104ba68559546e083da6518e diff --git a/server/src/music/PlayablePlaylist.cpp b/server/src/music/PlayablePlaylist.cpp index aede933..cb8b277 100644 --- a/server/src/music/PlayablePlaylist.cpp +++ b/server/src/music/PlayablePlaylist.cpp @@ -63,7 +63,8 @@ std::shared_ptr PlayablePlaylist::current_song(bool& aw if(this->properties()[property::PLAYLIST_CURRENT_SONG_ID].as() != id) /* should not happen */ this->properties()[property::PLAYLIST_CURRENT_SONG_ID] = id; - if(!entry || entry->metadata.requires_load()) return nullptr; + if(!entry) + return nullptr; if(entry->metadata.is_loading()) { if(entry->metadata.load_begin + seconds(30) < system_clock::now()) { @@ -113,10 +114,10 @@ std::shared_ptr PlayablePlaylist::playlist_next_entry() { auto replay_mode = this->properties()[property::PLAYLIST_REPLAY_MODE].as(); unique_lock playlist_lock(this->playlist_lock); - auto current_song = this->playlist_find(playlist_lock, this->currently_playing()); + auto old_song = this->playlist_find(playlist_lock, this->currently_playing()); if(replay_mode == ReplayMode::SINGLE_LOOPED) { - if(current_song) return current_song->entry; + if(old_song) return old_song->entry; if(this->playlist_head) return this->playlist_head->entry; this->properties()[property::PLAYLIST_FLAG_FINISHED] = true; @@ -125,9 +126,9 @@ std::shared_ptr PlayablePlaylist::playlist_next_entry() { std::shared_ptr result; if(replay_mode == ReplayMode::LINEAR || replay_mode == ReplayMode::LINEAR_LOOPED) { - if(current_song) { - if(current_song->next_song) - result = current_song->next_song->entry; + if(old_song) { + if(old_song->next_song) + result = old_song->next_song->entry; else if(replay_mode == ReplayMode::LINEAR_LOOPED && this->playlist_head) result = this->playlist_head->entry; else { @@ -148,14 +149,14 @@ std::shared_ptr PlayablePlaylist::playlist_next_entry() { result = songs.front(); } else { size_t index; - while(songs[index = (rand() % songs.size())] == (!current_song ? nullptr : current_song->entry)) { } + while(songs[index = (rand() % songs.size())] == (!old_song ? nullptr : old_song->entry)) { } result = songs[index]; } } playlist_lock.unlock(); - if(current_song && this->properties()[property::PLAYLIST_FLAG_DELETE_PLAYED].as()) { - this->delete_song(current_song->entry->song_id); + if(old_song && this->properties()[property::PLAYLIST_FLAG_DELETE_PLAYED].as()) { + this->delete_song(old_song->entry->song_id); } return result; }