mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-03-31 09:01:33 +02:00
- Add multi-select support to library_tracks_folder_screen (wishlist, loved, playlist) with long-press to enter selection mode, animated bottom bar with batch remove/download/add-to-playlist actions, and PopScope exit handling - Create batch showAddTracksToPlaylistSheet in playlist_picker_sheet with playlist thumbnail widget and cover image support - Add playlist grid selection tint overlay in queue_tab - Optimize collection lookups with pre-built _allPlaylistTrackKeys index and isTrackInAnyPlaylist/hasPlaylistTracks accessors - Eagerly initialize localLibraryProvider and libraryCollectionsProvider - Enable SQLite WAL mode and PRAGMA synchronous=NORMAL across all databases - Go backend: duplicate SAF output FDs before provider attempts to prevent fdsan abort on fallback retries; close detached FDs after download completes - Go backend: rewrite compatibilityTransport to try HTTPS first and only fallback to HTTP on transport-level failures, preventing redirect loops - Go backend: enforce HTTPS-only for extension sandbox HTTP clients
36 lines
588 B
Go
36 lines
588 B
Go
//go:build !windows
|
|
|
|
package gobackend
|
|
|
|
import "syscall"
|
|
|
|
func dupOutputFD(fd int) (int, error) {
|
|
return syscall.Dup(fd)
|
|
}
|
|
|
|
func truncateFD(fd int) error {
|
|
return syscall.Ftruncate(fd, 0)
|
|
}
|
|
|
|
func seekFDStart(fd int) error {
|
|
_, err := syscall.Seek(fd, 0, 0)
|
|
return err
|
|
}
|
|
|
|
func closeFD(fd int) error {
|
|
return syscall.Close(fd)
|
|
}
|
|
|
|
func isBestEffortTruncateError(err error) bool {
|
|
switch err {
|
|
case syscall.EPERM, syscall.EACCES, syscall.EINVAL, syscall.ESPIPE, syscall.ENOSYS:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
func isBadFD(err error) bool {
|
|
return err == syscall.EBADF
|
|
}
|