Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Recommendarr is a web application that generates personalized TV show and movie

## [🎮 Join our Discord Community!](https://discord.gg/uHy3KFbgPR)

> **⚠️ IMPORTANT**: When accessing this application from outside your network, you must open the application port on your router/firewall (default: 3000). See the [Reverse Proxy Setup](https://github.com/fingerthief/recommendarr/wiki/Reverse-Proxy-Setup) wiki page for secure setup guidance.
> **⚠️ IMPORTANT**: When accessing this application from outside your network, you must open the application port on your router/firewall (default: 3000). Alternatively, see the [Reverse Proxy Setup](https://github.com/fingerthief/recommendarr/wiki/Reverse-Proxy-Setup) wiki page for secure setup guidance.

> **⚠️ PORT CONFIGURATION**: The application now uses a single port (default: 3000) for both the frontend and API, configurable via the `PORT` environment variable. See [Environment Variables](https://github.com/fingerthief/recommendarr/wiki/Environment-Variables).

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recommendarr",
"version": "1.4.3",
"version": "1.4.4",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
56 changes: 54 additions & 2 deletions server/utils/databaseService.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ class DatabaseService {
-- Migration flags
fullDatabaseStorageMigrationComplete INTEGER DEFAULT 0,

-- Watch history usage flags
plexUseHistory INTEGER DEFAULT 1,
jellyfinUseHistory INTEGER DEFAULT 1,
traktUseHistory INTEGER DEFAULT 1,
tautulliUseHistory INTEGER DEFAULT 1,

FOREIGN KEY (userId) REFERENCES users(userId) ON DELETE CASCADE
)
`);
Expand Down Expand Up @@ -902,6 +908,12 @@ class DatabaseService {
previousTVRecommendations: JSON.parse(userData.previousTVRecommendations || '[]'),
currentTVRecommendations: JSON.parse(userData.currentTVRecommendations || '[]'),

// Watch history usage flags
plexUseHistory: Boolean(userData.plexUseHistory),
jellyfinUseHistory: Boolean(userData.jellyfinUseHistory),
traktUseHistory: Boolean(userData.traktUseHistory),
tautulliUseHistory: Boolean(userData.tautulliUseHistory),

// Migration flags
fullDatabaseStorageMigrationComplete: Boolean(userData.fullDatabaseStorageMigrationComplete)
};
Expand Down Expand Up @@ -1163,6 +1175,18 @@ class DatabaseService {
case 'fullDatabaseStorageMigrationComplete':
values.push(settings.fullDatabaseStorageMigrationComplete ? 1 : 0);
break;
case 'plexUseHistory': // Add this case
values.push(settings.plexUseHistory ? 1 : 0);
break;
case 'jellyfinUseHistory': // Add this case
values.push(settings.jellyfinUseHistory ? 1 : 0);
break;
case 'traktUseHistory': // Add this case
values.push(settings.traktUseHistory ? 1 : 0);
break;
case 'tautulliUseHistory': // Add this case
values.push(settings.tautulliUseHistory ? 1 : 0);
break;
default:
// For any other columns, push null or a default value
values.push(null);
Expand Down Expand Up @@ -1601,7 +1625,11 @@ class DatabaseService {
'traktOnlyMode',
'useCustomPromptOnly',
'useStructuredOutput',
'fullDatabaseStorageMigrationComplete'
'fullDatabaseStorageMigrationComplete',
'plexUseHistory',
'jellyfinUseHistory',
'traktUseHistory',
'tautulliUseHistory'
];

// Number settings
Expand Down Expand Up @@ -1686,7 +1714,11 @@ class DatabaseService {
'traktOnlyMode',
'useCustomPromptOnly',
'useStructuredOutput',
'fullDatabaseStorageMigrationComplete'
'fullDatabaseStorageMigrationComplete',
'plexUseHistory',
'jellyfinUseHistory',
'traktUseHistory',
'tautulliUseHistory'
];

// For timestamp values, ensure they are properly formatted as strings
Expand Down Expand Up @@ -1854,6 +1886,26 @@ class DatabaseService {
name: 'traktRecentLimit',
type: 'INTEGER',
default: '50'
},
{
name: 'plexUseHistory',
type: 'INTEGER',
default: '1'
},
{
name: 'jellyfinUseHistory',
type: 'INTEGER',
default: '1'
},
{
name: 'traktUseHistory',
type: 'INTEGER',
default: '1'
},
{
name: 'tautulliUseHistory',
type: 'INTEGER',
default: '1'
}
];

Expand Down
28 changes: 22 additions & 6 deletions src/components/RecommendationResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -909,15 +909,31 @@ export default {
gap: 10px; /* Tighter spacing between sections */
}

/* Make description more concise in horizontal layout */
/* Remove ellipsis and line clamping for all content sections in horizontal layout */
.horizontal-layout .description p,
.horizontal-layout .reasoning-content p,
.horizontal-layout .full-text p {
display: -webkit-box;
-webkit-line-clamp: 3; /* Limit to 3 lines */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
display: block;
-webkit-line-clamp: unset;
-webkit-box-orient: unset;
overflow: visible;
text-overflow: unset;
}

/* Remove any max-height constraints */
.horizontal-layout .description,
.horizontal-layout .reasoning,
.horizontal-layout .full-text {
max-height: none;
overflow: visible;
}

/* Remove the ellipsis limitation specifically for reasoning-content */
.horizontal-layout .reasoning-content p {
display: block; /* Override the -webkit-box display */
-webkit-line-clamp: unset; /* Remove line clamp */
overflow: visible; /* Allow content to be fully visible */
text-overflow: unset; /* Remove ellipsis */
}

.description {
Expand Down
45 changes: 10 additions & 35 deletions src/services/ImageService.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,18 @@ class ImageService {
try {
let showInfo = null;

// If TMDB isn't already configured, try to load its credentials first
if (!tmdbService.isConfigured()) {

await tmdbService.loadCredentials();
}

// Check if TMDB is configured - prefer TMDB if available
if (tmdbService.isConfigured()) {

// First check if TMDB is already configured before trying to load or use it
if (tmdbService.isConfiguredSync()) {
try {
showInfo = await tmdbService.findSeriesByTitle(title);

// If first attempt fails, try with a simplified title (remove everything after ":")
// Try simplified title only if TMDB failed but is configured
if ((!showInfo || !showInfo.images || !showInfo.images.length) && title.includes(':')) {
const simplifiedTitle = title.split(':')[0].trim();
showInfo = await tmdbService.findSeriesByTitle(simplifiedTitle);
}

// If still no results, try without special characters
// Try alphanumeric only if TMDB failed but is configured
if (!showInfo || !showInfo.images || !showInfo.images.length) {
const alphanumericTitle = title.replace(/[^\w\s]/g, ' ').trim().replace(/\s+/g, ' ');
if (alphanumericTitle !== title) {
Expand All @@ -77,10 +70,8 @@ class ImageService {
}
}

// If TMDB failed or isn't configured, try Sonarr as fallback only if it's configured
// Only try Sonarr if TMDB failed or isn't configured
if ((!showInfo || !showInfo.images || !showInfo.images.length) && sonarrService.isConfigured()) {


// Use Sonarr to find the show info
showInfo = await sonarrService.findSeriesByTitle(title);

Expand All @@ -101,7 +92,6 @@ class ImageService {

// Return null if we couldn't find anything
if (!showInfo || !showInfo.images || !showInfo.images.length) {

return null;
}

Expand All @@ -115,14 +105,12 @@ class ImageService {
// Get original URL (either from TMDB or Sonarr)
const originalUrl = poster.remoteUrl;


// Return either direct URL or proxied URL based on useProxy flag
if (useProxy) {
// Create a proxied URL to avoid CORS and network issues
const apiBaseUrl = process.env.VUE_APP_API_URL || window.location.origin + '/api';
const proxiedUrl = `${apiBaseUrl}/image-proxy?url=${encodeURIComponent(originalUrl)}`;


// Store in cache for future requests
this.posterCache.set(cacheKey, proxiedUrl);
return proxiedUrl;
Expand Down Expand Up @@ -173,42 +161,32 @@ class ImageService {
try {
let movieInfo = null;

// If TMDB isn't already configured, try to load its credentials first
if (!tmdbService.isConfigured()) {

await tmdbService.loadCredentials();
}

// Check if TMDB is configured - prefer TMDB if available
if (tmdbService.isConfigured()) {

// First check if TMDB is already configured before trying to load or use it
if (tmdbService.isConfiguredSync()) {
try {
movieInfo = await tmdbService.findMovieByTitle(title);

// If first attempt fails, try with a simplified title (remove everything after ":")
// Try simplified title only if TMDB failed but is configured
if ((!movieInfo || !movieInfo.images || !movieInfo.images.length) && title.includes(':')) {
const simplifiedTitle = title.split(':')[0].trim();
movieInfo = await tmdbService.findMovieByTitle(simplifiedTitle);
}

// If still no results, try without special characters
// Try alphanumeric only if TMDB failed but is configured
if (!movieInfo || !movieInfo.images || !movieInfo.images.length) {
const alphanumericTitle = title.replace(/[^\w\s]/g, ' ').trim().replace(/\s+/g, ' ');
if (alphanumericTitle !== title) {
movieInfo = await tmdbService.findMovieByTitle(alphanumericTitle);
}
}

} catch (tmdbError) {
console.error(`TMDB search failed for "${title}":`, tmdbError);
movieInfo = null;
}
}

// If TMDB failed or isn't configured, try Radarr as fallback only if it's configured
// Only try Radarr if TMDB failed or isn't configured
if ((!movieInfo || !movieInfo.images || !movieInfo.images.length) && radarrService.isConfigured()) {


// Use Radarr to find the movie info
movieInfo = await radarrService.findMovieByTitle(title);

Expand All @@ -229,7 +207,6 @@ class ImageService {

// Return null if we couldn't find anything
if (!movieInfo || !movieInfo.images || !movieInfo.images.length) {

return null;
}

Expand All @@ -243,14 +220,12 @@ class ImageService {
// Get original URL (either from TMDB or Radarr)
const originalUrl = poster.remoteUrl;


// Return either direct URL or proxied URL based on useProxy flag
if (useProxy) {
// Create a proxied URL to avoid CORS and network issues
const apiBaseUrl = process.env.VUE_APP_API_URL || window.location.origin + '/api';
const proxiedUrl = `${apiBaseUrl}/image-proxy?url=${encodeURIComponent(originalUrl)}`;


// Store in cache for future requests
this.posterCache.set(cacheKey, proxiedUrl);
return proxiedUrl;
Expand Down
Loading