Most scholars understand Chapter 8 addresses a question the Corinthians asked about eating food which had been offered to idols:
Now concerning food offered to idols... (1 Corinthians 8 ESV)
Since this issue had been "settled" by the Jerusalem Council, Paul's answer is expected to be, "No. Food offered to idols must be avoided."
19 Therefore my judgment is that we should not trouble those of the Gentiles who turn to God, 20 but should write to them to abstain from the things polluted by idols, and from sexual immorality, and from what has been strangled, and from blood. 21 For from ancient generations Moses has had in every city those who proclaim him, for he is read every Sabbath in the synagogues.” (Acts 15)
Instead of this obvious response, Paul takes three chapters for a lengthy discussion before giving an answer which is obviously at odds with the decision from the Jerusalem Council:
23 “All things are lawful,” but not all things are helpful. “All things are lawful,” but not all things build up. 24 Let no one seek his own good, but the good of his neighbor. 25 Eat whatever is sold in the meat market without raising any question on the ground of conscience. 26 For “the earth is the Lord's, and the fullness thereof.” 27 If one of the unbelievers invites you to dinner and you are disposed to go, eat whatever is set before you without raising any question on the ground of conscience. 28 But if someone says to you, “This has been offered in sacrifice,” then do not eat it, for the sake of the one who informed you, and for the sake of conscience— 29 I do not mean your conscience, but his. For why should my liberty be determined by someone else's conscience? 30 If I partake with thankfulness, why am I denounced because of that for which I give thanks?
31 So, whether you eat or drink, or whatever you do, do all to the glory of God. 32 Give no offense to Jews or to Greeks or to the church of God, 33 just as I try to please everyone in everything I do, not seeking my own advantage, but that of many, that they may be saved. (! Corinthians 10)
Judging from this response, the issue in Corinth involves Paul's own actions. If I partake with thankfulness, why am I denounced because of that for which I give thanks? The exact form of the question is not given, but likely it was something like, "How can you be a true Apostle if you eat food offered to idols?" Paul defends his actions with an answer which is focused on the difference between knowledge and love before getting in the details in the issue of food.
As the OP notes, Paul says one with the weaker faith sees eating as a legal issue. Their knowledge is lacking since they do not understand everything is from the Lord and should be handled as such. But, the proper response in all situations where a weaker believer is present, is to forgo your privileges out of consideration for the other. That is law of love.
Eat whatever is set before you without raising question. Table fellowship should not be a time for questioning another's eating habits. This is true for all meat, not just that offered to idols:
Therefore, if food makes my brother stumble, I will never eat meat, lest I make my brother stumble. (1 Corinthians 8:13)
κρέας literally flesh. It is the generic term for meat, not
εἰδωλόθυτος which is "idol meat." Paul says he would not eat or offer meat to a vegetarian. To do so would be a failure to act with love. Paul's reasoning cuts both ways, the vegetarian should not make an issue over someone's decision to eat meat.
Paul is getting to the heart of the problems in Corinth. Those with greater knowledge are using it to put others down. It is a form of arrogance and it demonstrates the lack of knowledge about love. The overriding principle in all situations, not just with idol meat, is to respond with love. If someone believes certain food should not be eaten, do not debate their freedom to eat what they choose; rather enjoy the meal. If someone objects about the food, the correct doctrinal response is not found in food. It is found in love for others.
Is James Weaker?
In comparing Acts 15 with the situation in Corinth, it is wrong to place James in a group of weaker faith. Acts clearly states those with the weaker faith are those who came, without authorization from Jerusalem:
1 But some men came down from Judea and were teaching the brothers, “Unless you are circumcised according to the custom of Moses, you cannot be saved.”...24 Since we have heard that some persons have gone out from us and troubled you with words, unsettling your minds, although we gave them no instructions. (Acts 15)
It is true the restrictions James places are those consistent with those who Paul terms, "weaker." Yet there are some aspects of the requirement which must be considered. First, James is addressing an issue raised by those who are weaker. Paul would be in complete agreement one should not eat anything offered to idols when dining with those. Paul would add this extends beyond idol meat, and includes unclean animals or any meat if the other was vegetarian.
Second, as a practical matter, the requirement from James is a general rule, which most, even those who are not weaker would be in agreement. Even Paul says avoidance is always an appropriate response. True Paul offers exceptions to the general rule, but those exceptions say nothing about James' faith. If Paul had written a general instruction for multiple churches, his position would most likely be the same as James'. Since Paul is writing to the Corinthians, a church he established, he is in a position to address exceptions to the general rule.
Finally, James says to abstain from things polluted by idols. There is some "wiggle room" because as Paul explains, idols are nothing and are incapable of "polluting" things. In a very real sense, Paul explains how it is the individual or group understanding which determines if something has been "polluted" by an idol.